Graeme Leighfield
Graeme Leighfield

Reputation: 3005

Show posts from every category except 'x'

I can't seem to find any documentation into the fishpig magento wordpress integration to the getPosts() method.

I simply need to call this method with an exclusion to a single category.

I would expect it to be something like

$id = 123;
$this->getPosts(array('category!=' => $id));

Any help greatly appreciated, thanks!

Upvotes: 0

Views: 103

Answers (1)

Ben Tideswell
Ben Tideswell

Reputation: 1697

The easiest way to achieve this is using the Ultimate Category Excluder plugin for WordPress:

https://wordpress.org/plugins/ultimate-category-excluder/

This will allow you to exclude products that belong to certain categories from appearing in your main blog feed. For this to work while integrated into Magento, you will need the following add-on extension:

http://fishpig.co.uk/magento/wordpress-integration/ultimate-category-excluder/

Ensure that the WordPress Integration module in Magento is upto date before installing this add-on extension.

Upvotes: 1

Related Questions