ThemeShaper Forums » Thematic

Use of Filter or Hook to display single post on homepage

(3 posts)
  • Started 12 years ago by BriceIrvine
  • Latest reply from allancole
  • This topic is resolved
  1. BriceIrvine
    Member

    I'm looking for a simple way to isolate just one post on my home page using a Thematic filter or hook. I created a home.php page by duplicating the Thematic index.php.

    How and where might I insert the code:

    <?php
       if (is_home()) {
          query_posts("showposts=1");
       }
    ?>
    Posted 12 years ago #
  2. Put it somewhere before the loop.

    Cheers,

    Chris

    Posted 12 years ago #
  3. This did the trick for me:

    function single_post_on_homepage() { if(is_home()) { ?>
    
    <?php query_posts("showposts=1"); ?>
    
    <?php } }
    add_action('thematic_above_indexloop','single_post_on_homepage');

    Just add that bit of code to your functions.php file.

    Posted 12 years ago #

RSS feed for this topic

Reply

You must log in to post.