Getting back into the swing of the bloggly whatnots.

It is apparent that my updates are infrequent but do happen during chilly time months. I am revamping the website to be a little more useful and less bloggy like.

Example: updated post so now, when navigating in post, it displays the next and previous stories of that category. For posts that have multiple categories you then follow the first in the list of categories at the top. Such as this post which will have site info and tech next and previous should be site info.

Reason for the tech categorization is that to make it function that way it took me a second to re-code it correctly to do so.

Here is the code you would normally see(or something like)

  1. <code><?php previous_post_link( '%link', __( 'Prev<span>
  2. </span> Previous', 'twentyeleven' )); ?></span>
  3. </code>
<code><?php previous_post_link( '%link', __( 'Prev<span>
</span> Previous', 'twentyeleven' )); ?></span>

But this only gets you the chronological order of all posts.

The function has a switch that you add “,TRUE” to the function just after the parenthesis where the theme name is mentioned (here ‘twentyeleven’) just as so:

  1. <code><?php previous_post_link( '%link', __( 'Prev<span>
  2. </span> Previous', 'twentyeleven' ),TRUE ); ?></span></code>
<code><?php previous_post_link( '%link', __( 'Prev<span>
</span> Previous', 'twentyeleven' ),TRUE ); ?></span></code>

Hope that helps someone.

You may also like...