Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Lotus WP theme - exclude category from Blog Page WordPress


I am using the Lotus WP theme:

And I need to exclude a category from showing on the blog page of my site.

As this is a custom theme, it doesn't adhere well to all of the 'fixes' on the internet. It's got it's own blog php file, so it's not your typical WP install (just so we're clear ;) ).

It's also not fixable by a plugin (as far as I know.. but I've tried a lot). The developer confirmed this to me and suggested that I come here for answers. I need to exclude category 16 from the page so please help me out. :)

I've attached the blog php files in the event that someone wants to look at them. Thanks in advance!

Answers (5)


Francisco Javier Carazo Gil answers:

In blog.php look for $query_string ="post_type=post&paged=$paged"; in line 160 and change it with:

$query_string ="post_type=post&paged=$paged&cat=-16";

That's all.

mvancleve comments:

Worked like a charm!

Francisco Javier Carazo Gil comments:

Perfect, vote me please :)

mvancleve comments:

I tried, but it says:

3 groups of people are allowed to vote:
The true elite who've earned 1% of all winnings on the site.
The top monthly experts.
The admins of this site.
All votes are public.

If you have already voted, you can not vote again.

Once an answer receives more downvotes than upvotes, then it is no longer displayed on the question page.

You are not allowed to vote.

Francisco Javier Carazo Gil comments:

I never have asked before but I thought that asker could vote. Look at something like question solved, I don't know exactly.


Michael Caputo answers:

You need to include:

in your query string.


Arnav Joy answers:

in blog.php

find the line no.168


replace it from

$query_string.= '&cat=-'.$cat_id;


where $cat_id is the id of the category you want to exclude


Dan | gteh answers:

Im banking on the fact that there is an setting in the Options Panel for the theme that lets you exclude categories because of this:

query_string.= '&cat=-'.$cat_id;

$cat_id would have to come from somewhere

mvancleve comments:

Theres not :( confirmed by the developer


Dbranes answers:

try this filter in blog.php

function exclude_category($query) {
//if (is_page('blog')) {
$query->set('cat', '-16');
return $query;
add_filter('pre_get_posts', 'exclude_category');

where 16 is the category_id to exclude and 'blog' is the name of your page where the exclude is to take place.