• 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    https://codex.www.ads-software.com/Template_Tags/query_posts#Exclude_Categories_From_Your_Home_Page

    Thread Starter kate0721

    (@kate0721)

    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”>)

    Thread Starter kate0721

    (@kate0721)

    got it working!!!

    TY TY TY so much!! ^_^

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attempting to create a “publish” post that will not be displayed in main page’ is closed to new replies.