Hide the last Previous Posts Link

Community Forums Forums Design Tips and Tricks Hide the last Previous Posts Link

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  DavidF 1 year, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39265

    handsonaswegrow
    Participant
    Post count: 31

    My blog is hands on : as we grow.

    I’ve noticed that the “Older Posts” button (previous_posts_link) shows still at the end and goes to a 404 page when there’s no more. It also shows on WP pages.

    How can I hide the previous_posts_link on the last page? As well as on pages?

    Currently, I’m using code in the Simple Hooks plugin to make it an image (instead of using the standard text) as well as skipping over one category (306).

    [html]
    <div class="prev_next">
    <div class="nav_right">
    <span class="prev"><?php
    previous_posts_link(‘<img src="http://handsonaswegrow.com/wp-content/uploads/newer-posts.png"&gt;’, $excluded_categories = ‘306’); ?></span></div>
    <div class="nav_left">
    <span class="next"><?php next_posts_link
    (‘<img src="http://handsonaswegrow.com/wp-content/uploads/older-posts.png"&gt;’, $excluded_categories = ‘306’); ?></span></div>
    </div>
    [/html]

    How can I add conditional code to not show on pages?

    How can I not show the “Older Posts” link when its the last page in pagination?

    http://handsonaswegrow.com
    #49151

    DavidF
    Participant
    Post count: 36

    To turn off the link on ‘all’ posts you can simply use

    display:none

    If you only want it off on certain post you can use the same code above but also give the post a body style class in the post CSS settings.

    Love you blog!

    Dave


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.