• I am trying to add posts to other pages besides the home page. Right now my header bar is
    Clubhouse – About – Golf Reviews – Golf Courses
    I would like to add posts to Golf Courses, for instance, but they are just going to Clubhouse. I’ve tried adding categories and listing that on the posts thinking they would direct to the appropriate page, but it’s not working and I’m at a loss.

    I’m very new to WP and would really appreciate any advise.
    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • All new posts show on your Home page. However they will also be listed on their relevant category pages. By the sounds of it, your top menu lists static Pages – not link to categories.

    Thread Starter jubespro

    (@jubespro)

    okay that is helpful, but I’m not sure how to change it. My site is http://thegabbygolfer.com. I’ve made categories and have added them to my posts, but they still are only showing up on the homepage (clubhouse)

    Ok make a copy of your page.php file, and save it as something like “page_golf_courses.php”. After it’s saved paste this into the very top of the file before anything else:

    <?php
    /*
    Template Name: Golf Courses
    */
    ?>

    Then if you have a loop in the code for that page replace it with this:

    <?php query_posts('category_name=golf-courses&showposts=10'); ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <div>
    <h2 id="post-<?php the_ID(); ?>" ><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    <?php the_content(); ?>
    
    </div>
    
    <?php endwhile; ?>

    Basically what that’s doing is it’s querying all posts filed under the category “golf-courses”. You’ll have to change that in the first line to reflect the category slug. Then it will only pull up entries for that category on that page.

    After you save and upload go to edit that page through your admin area, and off to the right is a drop down menu to pick the page template. You should see an option in there called Golf Courses. Pick that and it should work!

    Rinse and repeat for the other pages…

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding posts to other pages besides homepage’ is closed to new replies.