WordPress.org

Ready to get started?Download WordPress

Forums

Attempting to create a "publish" post that will not be displayed in main page (4 posts)

  1. kate0721
    Member
    Posted 4 years ago #

    Hi,

    Question: I am trying to figure out how to create a "published post", that will not display within the main page.

    This publish post will have its own permalink and the difference is that this post will not be automatically added to the main page.

    Thanks,
    Kat

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    Is this going to be a "one-off" or are you likely to want to have publish of this "not on the front page" posts? If it's the latter, then one approach might be to create a special category just for these posts and then exclude that entire category from the blog's main page using query_posts.

    http://codex.wordpress.org/Template_Tags/query_posts#Exclude_Categories_From_Your_Home_Page

  3. kate0721
    Member
    Posted 4 years ago #

    Thanks for the response. Your solution is what I am looking for. ^_^

    <?php
    if (is_home()) {
    query_posts("cat=-101");
    }
    ?>

    I've inserted the script above within index.php and it does not work. I would like to confirm by category ID, would that be equivalent to category slug? Also, can I put the above script anyhere within index.php? (currently putting it under <div id="main">)

  4. kate0721
    Member
    Posted 4 years ago #

    got it working!!!

    TY TY TY so much!! ^_^

Topic Closed

This topic has been closed to new replies.

About this Topic