heykevin
asked on
How to change the nav links below single posts to similar category posts - in WordPress.
Hey Experts!
I need to customize a WordPress theme for one of my clients. She wants to change up the links that are served below each post when it's pulled up in its own post page. (within single.php) By default, WP calls the last and next posts. She wants it to pull 2 recent titles within the same category. For instance, for her post at
http://www.archaeologyrevealed.com/power-of-ideology2
the two links below "People who read this article also found these articles of interest:" would be the latest posts from the category 'archaeological sites.' (The category would vary by post.)
Here is how I have modified the code thus far:
<div id="nav-below" class="navigation">
<h3>Extend the Dialogue</h3>
<p>People who read this article also found these articles of interest: </p>
<ul>
<li class="nav-previous"><em>< ?php previous_post_link( '%link', '%title' ); ?></em></li>
<li class="nav-next"><em><?php next_post_link( '%link', '%title' ); ?></em></li>
</ul>
</div><!-- #nav-below -->
What php do I use to call the latest same category titles?
Thanks..... Tricia
I need to customize a WordPress theme for one of my clients. She wants to change up the links that are served below each post when it's pulled up in its own post page. (within single.php) By default, WP calls the last and next posts. She wants it to pull 2 recent titles within the same category. For instance, for her post at
http://www.archaeologyrevealed.com/power-of-ideology2
the two links below "People who read this article also found these articles of interest:" would be the latest posts from the category 'archaeological sites.' (The category would vary by post.)
Here is how I have modified the code thus far:
<div id="nav-below" class="navigation">
<h3>Extend the Dialogue</h3>
<p>People who read this article also found these articles of interest: </p>
<ul>
<li class="nav-previous"><em><
<li class="nav-next"><em><?php
</ul>
</div><!-- #nav-below -->
What php do I use to call the latest same category titles?
Thanks..... Tricia
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad it worked. Cheers.
ASKER
<div id="nav-below" class="navigation">
<h3>Extend the Dialogue</h3>
<p>People who read this article also found these articles of interest: </p>
<ul>
<li class="nav-previous"><em><
<li class="nav-next"><em><?php
</ul>
</div>
And it worked. There is soooo much documentation out there, it can be a real challenge finding the right page. Thanks for pointing me in the right direction.