ThemeShaper Forums » Thematic

[closed]

exclude certain categories from featuresite front page

(3 posts)
  • Started 9 years ago by jamielt
  • Latest reply from jamielt
  • This topic is resolved
  1. Hi All

    I am trying to find out how to exclude certain categories from the thematic featuresite theme front page. I have searched the forum posts to no avail. Thanks for your help.

    Posted 9 years ago #
  2. I'm not sure that this will work, but try replacing this line in front-page.php:

    <?php
                      $recentPosts = new WP_Query();
                      $recentPosts->query('showposts=5');
                  ?>

    with:

    <?php
                      $recentPosts = new WP_Query();
                      $recentPosts->query('showposts=5&cat=-3');
                  ?>

    3, in this case, is the category id you are excluding.

    Posted 9 years ago #
  3. Hey Thanks Devin;
    Thanks for your reply. I am new to Wordpress... trying to learn.

    I played around with what you gave me and came up with this:

    <?php
                      $recentPosts = new WP_Query();
                      $recentPosts->query('category_name=news&showposts=5');
                  ?>

    It works :)

    jamielt

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.