Forums

Next page link and previous page link (12 posts)

  1. cypress
    Member
    Posted 7 years ago #

    I am currently using WP1.2.1 and I am wondering how to put a link that links to pages with older posts. I have my site set to 10 entries on the index page, so I want links to the older pages. Then on the older pages, i would like to have links to even older pages, or newer pages, and a Home page link. Is that possible and what code would i need???? I saw some post earlier on that, and a buch of code, but i need more help and explanation as to where to put the code that you provide me.

    Thanks for the help!!

    +Cypress

  2. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Have a look at my site - that what you want ?

    (Click my name)

  3. James
    Happiness Engineer
    Posted 7 years ago #

  4. cypress
    Member
    Posted 7 years ago #

    Yes, that is what I want to have on my site, plus maybe a link to the home page/index, but what you have on your site is just fine for me. Can you please tell me how to do it???? (PODZ)

  5. Mark (podz)
    Support Maven
    Posted 7 years ago #

    (I'm using 1.5, but this has worked on my site since 1.2)
    Here we go....wrong way round first:

    When a single page is viewed, you see this at the top:
    Previous Story> > || Home || < <Next Story

    Code:
    <?php if ($single) { ?>
    <div class="cent">
    <?php previous_post('%', '', 'yes', 'no', 1, '') ?>
    > > || <a href="http://www.tamba2.org.uk/T2" title="Home">Home</a> || < <<?php next_post('%', '', 'yes', 'no', 1, '') ?>
    <br />
    <br />
    </div>
    <?php } ?>

    That code gets put directly above this line:
    <div class="post">

    You can of course change the symbols.

    ======================

    The navigation at the base of the page:
    You must have 'posts paged' selected in Options - it will not work otherwise.
    Put these lines at the bottom of the post div.

    <div class="left"><?php posts_nav_link('','« Newer Posts','') ?></div>
    <div class="right"><?php posts_nav_link('','','Older Posts »') ?></div>

    The function name could have changed between 1.2.1 and 1.5 though ...... post back if you have problems, though I thought Kubrick had this built in.

  6. georgianlady
    Member
    Posted 7 years ago #

    I have 1.2.2 or 1.2.1 whichever, I mean both on different sites, don't recall what is what, with more than 2 installs right now ...

    In any case, I don't have mod_rewrite and have chosen to have pretty urls via appending the virtul site structure onto the url.

    so it's

    index.php/archives/...

    but this and every other page pagination won't work right ....

    Clicking on the "older posts" appends a '?' to 'index.php' which makes this non-effective for my use :)

    What do I need to HACK, where and what exactly, to fix this problem?

    What file? I can do some PHP stuff, but don't know where to look, and if it's complicated I'm toast.

    :)

  7. georgianlady
    Member
    Posted 7 years ago #

    .::BUMP::.

    I'm still looking for help on the above!

  8. Michiel
    Member
    Posted 7 years ago #

    @Podz: thanks, this works very well! Perhaps a stuppid question.... is there a way to change the font/layout of the text? What should I change in the .css file? Many thanks!

  9. Mark (podz)
    Support Maven
    Posted 7 years ago #

    @Michiel:
    Yes - the best way to do that would be to enclose all of that inside a div, then style it:

    <div class="navigation">
    ---the stuff above---
    </div>

    And in the css:
    .navigation {
    font-family: ....
    color: ...
    }

  10. Michiel
    Member
    Posted 7 years ago #

    Ah:-) of course! Thanks!!!

  11. chuckblue
    Member
    Posted 7 years ago #

    I was able to get the newer posts, older posts bit above to work on my wp 1.2 site, but the top version doesn't.

    No errors show, and neither does the navigation.

    edit: Hmm. It shows on my testblog... but not my public blog.

    I even uploaded the index.php file from my test blog to my public blog.

    the public blog is at:

    my warcraft blog

    It works on the test, but not the public. I checked and both have the same plugins. The home link is there, but not the next previous posts. I have the posts shown set at 1.

    Any suggestions ?

  12. chuckblue
    Member
    Posted 7 years ago #

    Never mind. I got the lesterchan.net page nav to work on my site.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.