Jump to content
ratputin

Post Navigation within a Category (How To)

Recommended Posts

ratputin+    2
ratputin

All,

After searching a bit, I put together a bit of code that allows the Post Nav to stay within it's category. All you need to do is open the file wp-content > themes > pagelines > sections > sections.php and;

Change this:


<div class="post-nav fix">

<span class="previous"><?php previous_post_link('%link') ?></span>

<span class="next"><?php next_post_link('%link') ?></span>

</div>	

To this:

<div class="post-nav fix">

<span class="previous"> <?php previous_post_link('%link', '%title', TRUE); ?> </span>

<span class="next"> <?php next_post_link('%link', '%title', TRUE); ?> </span>

</div>

Remember that if you update the framework, this will be overwritten.

HTH

~ Rat

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Thanks for sharing :D


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

The topic was marked as resolved.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • JP
      By JP+
      Hello,
      We are working on a 2 languages site (https://liguecardioliga.be) with wpml, and lately the call of a category in the loops section (and all the sections requiring a category to select posts) doesn't work in the translated language. It worked well until recently so I wonder if it's because of a recent update (wordpress, wpml, pagelines, a plugin?). Anyone has the same problem? a solution?
      TIA
    • Thijs
      By Thijs+
      Hi,
      somehow my post navigation won't show up beneath a post.
      Link to the website (Platform 5)
      Also with all plugins deactivated nothing shows up.
      I'd also like to make the post navigation visible on custom post types.
      What should I do:
      Continue to look for a CSS error? Or make a new section with a post navigation? ... ? Somebody give me hint please?
      Kind regards,
      Thijs
       
       
    • mzhafzah
      By mzhafzah
      Hello
      I am using DMS 2 theme and I want to create a 2 different links on my website; each link should take you to a different blog post category. Although the process is easy, yet I can not figure out how to give each category page a unique design of its own; Any change I make on any page is applied to the other (I'm aware of the universal elements like the header and footer and I a am not talking about these.)
      Since I am new to wordpress in general, I am not sure if my description is sufficient; apologies if it is not.
      TycoonJé
    • morrisjohnc
      By morrisjohnc
      Hello,
       
      My blog has two separate types of post content, both of which need to be created as posts, not pages, in WP.
       
      On the category pages, Bespoke pulls the featured image and the 10 word excerpt (or whatever is provided for in the excerpts post field).  How can I get certain categories to show the full content of a post and others this standard format with the "read more" button?
       
      Question 2 - Is it possible to have different templates for different category listing pages?  Example, use the postloop for one category and the masonic gallery for another?
       
      Thank you in advance for your help!
    • aldisney
      By aldisney+
      Hi--
      I was wondering if there was a relatively easy to way automatically assign a thumbnail to a post category when displaying posts in the Masonic Gallery format, when the post doesn't have a featured image? I've got a client with a ton of posts that just won't have any featured images, but each category has a header image. I'd like to display the header image as the thumbnail for all these posts, since, going forward, my client does actually plan to use featured images.
       
      Thanks!
×