• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Hide the last Previous Posts Link

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: navigation, pagination, posts, previous link

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 10 months ago by DavidF.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 4, 2013 at 10:41 am #39265
    handsonaswegrow
    Member

    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).

    <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">', $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">', $excluded_categories = '306'); ?></span></div>
     </div>
    

    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
    July 4, 2013 at 5:12 am #49151
    DavidF
    Member

    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


    David Frosdick WordPress Coaching

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble