WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Next Post problems (5 posts)

  1. tongueandcheek
    Member
    Posted 8 years ago #

    I followed the Template Tags suggestions and tried using their code but I'm not getting the results I want and I don't want to have to install a plug-in.

    The code on the WordPress Support pages looks like this essentially:

    <div class="navigation">
    <div class="alignleft"><?php previous_post('« %',
    '', 'yes'); ?>
    </div>
    <div class="alignright"> <?php next_post('% »',
    '', 'yes'); ?></div>
    </div> <!-- end navigation -->

    but no matter what I do I can't get the arrows on the next_post() to show up on the right and as part of the link. I also can't get both of these links to show up on the same line short of scripting up something that specifically nudges it up 20px.

    Does anyone have an example of what I want, two links on the same line aligned to the left and right? Or thoughts on how to make this work? I've exhuasted all the possibilities I can think of which includes forced floating or text-alignment.

  2. maerk
    Member
    Posted 8 years ago #

    Could you clarify what it was you were trying to do?

  3. maerk
    Member
    Posted 8 years ago #

    My next and previous code looks like this:

    <div class="navigation">
    <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
    <div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    </div>

    And then I use floats to make each class align to the proper side. You'll need to make sure the very next element has clear: both; set on it, or it will appear in between the two.

  4. tongueandcheek
    Member
    Posted 8 years ago #

    that worked quite well... now for the second part of the problem, how to get it so that the arrows are actually part of the link?

    is this possible?

  5. maerk
    Member
    Posted 8 years ago #

    It's always a good idea to get in the habit of checking the codex:

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic