Tagged: post navigation, previous next navigation
- This topic has 1 reply, 2 voices, and was last updated 3 years, 1 month ago by Theme Horse Support Team.
-
AuthorPosts
-
February 17, 2021 at 7:42 pm #86365the5krunner.comParticipant
on the home page i want to
1. allow the user to click to see the next page of older posts
but
2. i want to stop them from choosing a specific pageie they can only click to see the next page (newer or later)
ie to get to the first ever page would take a LONG time!thank you
March 3, 2021 at 11:21 am #86767Theme Horse Support TeamKeymasterHi there,
For to stop visitors from choosing a specific page and only click to see the next page (newer or later) just go to theme main directory/index.php on line no:67 you will find below line of code:
<?php the_posts_pagination( array( 'prev_text' => __( 'Previous', 'newscard' ), 'next_text' => __( 'Next', 'newscard' ), ) );
replace the above code with below one:
<div class="navigation nc-nav"> <p><?php posts_nav_link('',__( 'Previous', 'newscard' ),__( 'Next', 'newscard' )); ?></p> </div><?php
Also paste the below custom CSS code in Appearance > Customize > Additional CSS for style for those links:
.navigation.nc-nav a { display: inline-block; color: #333; padding: 15px 25px; margin: 0 1px 3px; background-color: #ffffff; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); } .navigation.nc-nav a:hover { color: #fff; background-color: #00236e; border-color: transparent; text-decoration: none; position: relative; }
Note: We recommended you to customize the theme main code via child theme so that your code won’t lost while you update to the new version of the theme.
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.