Problem with Previous and Next Post (8 posts)

  1. yung_chi_lee
    Posted 11 years ago #


    My blog is at http://www.yunglee.com

    When I view my blog articles, there are links at the bottom to direct you to the next post or the previous post. However, these links seem to be "bunched" too close together. I've seen on sites like Coldforged's where those links are neatly spaced apart. What do you think is causing this? Could it be the size of my pics, or the length of the title, or the styling in the CSS file? Thanks for any help you can offer.


  2. moshu
    Posted 11 years ago #

    You have them in a "centered" div.

  3. yung_chi_lee
    Posted 11 years ago #

    Okay Moshu,

    So I located the class "centre" in the stylesheet.

    .center {
    text-align: center;

    What can I change to make the links apear the way I want it to?

  4. moshu
    Posted 11 years ago #

    I use this in my single.php template file:
    <div class="navigation">
    <div class="alignleft"><?php previous_post('&laquo; %','','yes') ?></div>
    <div class="alignright"><?php next_post(' % &raquo;','','yes') ?></div>

    .navigation {
    display: block;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 60px;
    margin-right: 30px;
    margin-left: 30px;

    .alignright {
    float: right;

    .alignleft {
    float: left

    Of course, the pixels values are fro my own design (Dark Maple).

  5. yung_chi_lee
    Posted 11 years ago #


    Here's how this section in my index.php file currently looks. From what you have suggested, what do I need to change in the coding to make it work. I know about changing the div class ids but its more the PHP side of things where I get lost. Thanks.

    <div class="center">
    <?php posts_nav_link('  ', __('« Previous'), __('Next »')); ?></div>

  6. moshu
    Posted 11 years ago #

    It seems we are talking about two different tags :)
    If you have a single.php template, please paste your code here http://pastebin.com/ and post back with the URI. If you don't, then paste the index.php.

  7. yung_chi_lee
    Posted 11 years ago #


    I posted my index.php file. I don't have a single.php file.

  8. moshu
    Posted 11 years ago #

    OK. Yes, I realized you don't. That's why you have to use the same template tag for 2 different tasks. (see: here in the Codex)
    At the above link you can also see several different ways of using it. (What I posted earlier was close to what is in Codex as "Kubrick format").
    You could try copy-paste from the Codex and replace what you have now + add some modification in the stylesheet.

    Edit. On a second thought: if you have LONG post titles it wouldn't help too much even if you put them in keft-right floated divs. They still will be close :)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.