SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page/post navigation (next/previous) Question

    I'd like to use a script that only goes to the next post/previous post in a particular category. This is the common code for filtering through posts:

    PHP Code:
                        <div id="post-next" class="one-half"><?php next_post_link('&larr; %link'); ?></div>
                        <div id="post-prev" class="one-half remove-margin"><?php previous_post_link('%link &rarr;'); ?></div>
    How do I edit this to navigate it through say Category ID 3?!

    THANKS IN ADVANCE!

    --Scott G.

  2. #2
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind I was able to figure out how to keep the pagination within a certain category... But the easy thing that I cannot figure out is how do I keep the "post title" as the "next link" ??

    PHP Code:
                        <div id="post-next" class="one-half"><?php next_post_link('&larr; %link''Previous Memorial'TRUE'3'); ?></div>
                        <div id="post-prev" class="one-half remove-margin"><?php previous_post_link('%link &rarr;''Next Memorial'TRUE'3'); ?></div>
    I'd like "Previous Memorial" & "Next Memorial" to be the actual post titles, but can't figure out how to make this happen?!? I'm sure it's something relatively simple.. But for me it is not.

    Any help would be greatly appreciated..!

    THANK YOU!

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,128
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Try using '%title' as the text instead of 'Previous Memorial' and 'Next Memorial'

  4. #4
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CPRADIO you rock! So simple it was stupid! I kept trying '%the_title'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •