WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 2 query_posts on front page "previous entry" link doesn't work (3 posts)

  1. tollboy
    Member
    Posted 5 years ago #

    Ok so here is the deal. I have been modding wordpres themes for a while, so I decided to up my game and try at writing my own theme. I am having to learn the little bit of PHP I need as I go. On this theme I am creating it is very similar to http://rin-windy.com . I was able to get the two different columns, with the different authors in each. Here is the code I used.

    <?php if (is_home()) { query_posts ("author=1") ; } ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    for the left side

    <?php  query_posts ("author=3"); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    for the right side

    This displays perfectly for the front page but then when I click my navigation buttons they take me to the second page but it has the same posts that were on the front page. Here is the code I am using for the navigation

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>

    Hopefully I am missing something simple here, I am a novice and would appreciate any help anyone can give me. Thanks

  2. tollboy
    Member
    Posted 5 years ago #

    Hate to bump this so soon but I could really use a hand.

  3. tollboy
    Member
    Posted 5 years ago #

    I was able to figure it out myself, it only costs me a few more hairs.
    The first line needed a query_string . So each query on either side should look like this.

    <?php query_posts ($query_string."&author=3"); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    and then you change the author accordingly.

Topic Closed

This topic has been closed to new replies.

About this Topic