• Resolved blork

    (@blork)


    I have zero training in PHP, but I’m pretty successful at making changes because I’ve been learning through trial and error. I say that so you’ll go easy on any replies you send (remember, I’m a php noob).

    Here’s the problem; my “Previous | Next” links work, but they go in reverse. In other words, “Next” shows me the OLDER posts while “Previous” shows me the newer ones. I realize this is a matter of taste, as Yahoo mail works this way, but to me it is counter-intuitive. Blogs are arranged chronologically, so “previous” should mean OLDER.

    Incidentally, I also want to change the text to OLDER and NEWER.

    Anyway, please guide me through the process of reversing this problem. On the relevant files I get this code at the bottom:

    <?php posts_nav_link(‘ – ‘,’« Prev’,’Next »’) ?>

    I made the following change:

    <?php posts_nav_link(‘ – ‘,’« Newer’,’Older »’) ?>

    … and that worked to change the labels. So now I get this on the page:

    << Newer – Older >>

    But what I want is this:

    << Older – Newer >>

    Obviously there’s more to it than just changing the labels. My problem is that I can’t figure out the logic or the syntax of the code. The way it’s written, it should produce:

    – << Newer Older>>

    As in, the dash seems to come first in the code, but not in the result. Also, what is the magic that makes “Newer” and “Older” know what link to make even when you change the text?

    Ultimately, how do I get what I want?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I haven’t seen the prev/next link code written like that before. Most themes use something along the lines of:

    <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>

    That being said, if you write it like this:

    <?php posts_nav_link(' - ','? Newer','Older ?') ?>

    and it is backwards, have you tried writing it like this?:

    <?php posts_nav_link(' - ','? Older','Newer ?') ?>

    Does that work to switch it???

    Thread Starter blork

    (@blork)

    Well, that would seem logical, sort of, but it doesn’t work. What I get LOOKS right:

    << Older – Newer >>

    But “Older” points to the newer posts and “Newer” points to the older posts.

    BTW, the way you describe the navigation is also in my templates, but at the top, and it includes the next and previous post title. I pulled that in from my previous template. What I’m working on now is the Older – Newer page links at the bottom of the page.

    Thread Starter blork

    (@blork)

    So duh! I went back to my old template and found the appropriate code:

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>
    </div>

    (Changing “Previous” to “Newer” and “Next” to “Older”), and it TOTALLY worked.

    OK, next stop, rocket science school! Thanks for your help!

    HA! Good! I was posting those links as you posted. Glad you figured it out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Prev | Next links are reversed’ is closed to new replies.