WordPress.org

Ready to get started?Download WordPress

Forums

Having the same post appearing on multiple pages? (5 posts)

  1. akashnayee
    Member
    Posted 2 years ago #

    Hi, I'm totally new to wordpress but I have a question, so my blog at the moment is http://www.techka.sh
    and as you can see there are multiple pages along the header such as news, video, blog.

    I'm quite inexperienced and new to WordPressbut would like to know if this can be achieved.

    What I'd like to do is whenever I make a post on the home page, have the option to simultaneously post it in the appropriate page. At the moment, I have a separate category for each page but am not sure how i can go about doing this so any help would be appreciated, thanks.

  2. Jonas Grumby
    Member
    Posted 2 years ago #

    There are at least a few ways. One way would be to create a template for each page and use query_posts or WP_Query to show only posts from one category on a page. If the category ID is 15 (for example) and you want to show 5 posts per page, you could replace the default query with one like this:

    <?php
    //The Query
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('posts_per_page=5&cat=15&paged=' . $paged);
    //The Loop
    if ( have_posts() ) : while ( have_posts() ) : the_post();
    
    ?>
  3. Jonas Grumby
    Member
    Posted 2 years ago #

    Read this to learn how to name your template files:

    http://codex.wordpress.org/Template_Hierarchy

  4. akashnayee
    Member
    Posted 2 years ago #

    I'm still a bit baffled about your suggestion as I'm an absolute beginner, firstly how do I create a template for each page, is there no simpler solution like switching the header tabs for categories or something similar such as a plugin?

  5. Jonas Grumby
    Member
    Posted 2 years ago #

    Try searching the plugins directory.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.