WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Excluding Particular Categories OR Tags from Home Page (2 posts)

  1. Ramnath
    Member
    Posted 2 years ago #

    Hello,

    Sorry for my ignorance in this particular query I have been searching for.

    I am using Mystique theme by digitalnature and I want to exclude particular categories or tags from the home page. I read the solution given at http://codex.wordpress.org/Template_Tags/query_posts#Exclude_Categories_From_Your_Home_Page

    I tried the following in index.php located in ~/public_html/smilepls.com/wp-content/themes/mystique but in vein. The code I used is:

    if (have_posts()):
            while (have_posts()):
             if (is_home()): //added
              query_posts('cat=-3'); //added
             endif; //added
              the_post();
              mystique_post();
            endwhile;
    ...

    Can anyone pls shed some lights on this issue? (WP ver: 3.1.3)

    Thanks in advance.

  2. Ramnath
    Member
    Posted 2 years ago #

    Ok I found the solution :)

    if (is_home()):
    	  query_posts('cat=-23');
           endif;
           if (have_posts()):
            while (have_posts()):
    	  the_post();
              mystique_post();
    	endwhile;
    ...

Topic Closed

This topic has been closed to new replies.

About this Topic