next-post-link in same category

  • Anonymous


    But how would i remove the auto nav and have this there only?

    .post-nav {
    display: none;



    I’ve got it working. What I’ve done is add category browsing under the blog post nav. Also, made it where on a single post id, only the category browsing is able to be done.

    code 1st widget:

    <div style="text-align:center;">Blog Post Navigation</div>

    <div style="clear:both;">
    <p id="previous">« <?php previous_post_link('%link','%title',TRUE); ?></p>
    <p id="next-post"><?php next_post_link('%link','%title',TRUE); ?> »</p>

    <div style="text-align:center;">Category

    $category = get_the_category();
    echo $category[0]->cat_name;

    Post Navigation</div>


    Code 2nd widget:

    <style type="text/css">
    #previous, #next-post{
    display: none;
    #cat-previous-post {
    float: left;
    margin-left: 8px;
    #cat-next-post {
    float: right;
    margin-right: 8px;
    text-align: right;
    #cat-previous-post, #cat-previous-post a, #cat-previous-post a:visited, #cat-next-post, #cat-next-post a, #cat-next-post a:visited {
    color: #929292;
    font: 12px tahoma;
    text-decoration: none;

    <div style="clear:both;">
    <p id="cat-previous-post">« <?php previous_post_link('%link','%title',TRUE); ?></p>
    <p id="cat-next-post"><?php next_post_link('%link','%title',TRUE); ?> »</p>

    <div style="text-align:center;">Browse different years of Officers</div>


    Thank you Ken for showing me the 2 plugins needed to make this work:

    PHP widget

    Widget logic


    Kenneth John Odle


    Glad to help!

Viewing 3 posts - 11 through 13 (of 13 total)

  • 1
  • 2
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!