Home>Support>how to omit one category from blog page?

how to omit one category from blog page?

I’ve been trying to omit one category from my blog page, and the code doesn’t seem to be working. Please note, I am not an experienced builder, so my knowledge is limited.

What I did (following many articles on the web), is go into the editor and edit the loop.php. I added this:

<?php if (is_blog-2_page() && !is_paged() 
) $posts = query_posts($query_string . '&cat=-164'); ?>	

Just above the endwhile.

BTW, I LOVE how easy you have made to edit everything in this theme! Great job :-)

URL: http://monmarchelocal.ca/blog-2/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 10 months ago Andrew Misplon
    Hi, I Work Here

    Hi Margaux

    Glad to hear things have been working out so far. Before going the child theme route, try this. On your blog page set the template to Default, not Blog. The page template drop down is in the right column. Next click over to our Page Builder tab, insert the Post Loop widget and use the last field of that widget to insert an argument:

    cat=-x

    Where x is the category ID you’d like to omit. Let us know how that goes.

  2. 9 years, 10 months ago Margaux Murray

    Hi Andrew,
    I just tried what you said, and it’s still not working. At the bar at the top, when I’m on the category I want, it says
    edit-tags.php?action=edit&taxonomy=category&tag_ID=164&post_type=post
    So, I was assuming that I should put
    cat=-164
    What am I doing wrong?

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More