• Hi, whenever I submit a new post, it automatically shows up on the homepage.

    I want to make a post not show up on front page, but I want it to be publically visibile and published if I link to it like this:

    mysite.com/news/345

    Anyone know how to do this?

    Cheers.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Just modify the homepage template not to show the posts?

    Did you want to not show any posts on the homepage at all? If so then just remove the loop that’s appearing in your homepage template.

    Thread Starter Floyd3

    (@floyd3)

    No, i still want some posts on the homepage.

    Other posts I just want to link to and not automatically show up on homepage.

    Yup well query the posts in your loop on the homepage to show which ones you want

    Thread Starter Floyd3

    (@floyd3)

    OK, thanks, I’m close to understanding.

    I created a category that will be invisible, this is what I want to do:

    Exclude Categories From Your Home Page
    Placing this code in your index.php file will cause your home page to display posts from all categories except category ID 3.

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

    My category number is 5, so I know to change that.

    The only thing is, I’m a noob and don’t want to mess anything up.

    It says to add that code to my index.php file… This is what my index.php file looks like:

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>

    Is that the right file? Do I just add the code to the bottom so it will look like this?

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>
    
    <?php
       if (is_home()) {
          query_posts("cat=-3");
       }
    ?>

    Nope, in your themes index.php file

    wp-content/themes/theme-name/index.php

    Add it to the top before the loop

    you need to edit the index.php file which you find in your theme folder (your example is the index.php from the wordpress core files – don’t edit that)

    Thread Starter Floyd3

    (@floyd3)

    Thanks, it worked!

    For anyone else in the future trying to do this, I had to put the code towards the top of the index.php file for it to work.

    Thanks again for all the help.

    Cheers.

    Thread Starter Floyd3

    (@floyd3)

    Ohh, I just saw you said to add it to the top xdesi oops… hehe.

    Nice one ??

    Thank you guys for this informations.
    If i have many posts listed in this category, are they will have same advantage as the posts listed on front page without using invisible category in search engine optimizations ?!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to make a post not show up on front page? Just want to link to to post’ is closed to new replies.