This article explains how to hide page navigation such as “Next Post” and “Previous Post” on WordPress sites using the Keni theme.
Procedure
-
Edit the single.php file
First, open the
single.phpfile in your theme directory. This file defines the layout of single post pages. -
Delete the target code
Find and delete the following code section:
<div class="page-nav-bf cont-nav"> <?php echo $next_link . "\n"; echo $prev_link . "\n"; ?> </div>By deleting this code, the links for next and previous posts will no longer be displayed. This also prevents the generation of unnecessary
divelements with classes.
Notes
-
Delete instead of commenting out
Avoid commenting out code that mixes PHP and HTML. By completely deleting the code, you can avoid unintended errors and problems.
By implementing this method, you can completely remove page navigation from single post pages in the Keni theme. Edit other template files in the same way as needed.