Affiliate Disclosure – NitinOffers.COM content is free. When you purchase through referral links on this site, we earn a commission. Learn more.
Have you installed the Astra theme recently and looking to disable the previous post / next post in the Astra WordPress theme? If yes so I can help you with a little code and some steps which you must follow to disable Next Post / Previous Post in WordPress theme in single/each post in WPAstra theme or Astra WordPress theme.
The code and instructions which I will give you, help you to remove the previous post / next post in the Astra WordPress theme for all devices like mobile, tablet, computer/laptop/desktop.
How to remove the previous post and next post in the WordPress Astra theme, single/each post?
Quite easy to do, just copy the given below code and follow next steps.
add_filter( 'astra_single_post_navigation_enabled', '__return_false' );
- Go to your WordPress admin dashboard or simply log in to your website.
- Go to the Appearance and then click on the theme editor.
- Search for functions.php and click on it.
- Click anywhere in the middle area of the functions.php code and scroll down to reach the end.
- Now paste the code as you copied above and save it.
Is it completed or do I need to do more anything?
Yes, you have done and there is no need to do more.
Is this permanent work?
No! This is not a permanent work. Let me explain you below.
Whenever the team or (WPAstra) the WordPress Astra theme will launch a new update so it removes all the custom code you installed in functions.php, header.php, style.css, or any other theme files. You would require to install all the code manually again.
To prevent this problem I would highly recommend you create a child theme for the WordPress Astra theme. To create a child theme of WordPress Astra theme check this small article, which I will advise.
Does given above code work with other WordPress themes as well to remove the next post and previous post links in single or each post?
Will this process work on all devices like mobile, tablet, tv, computer/laptop/desktop?
Yes, the code given above will help for all devices. Your website or single post of your website will not show the next post and previous post links to computer/laptop, mobile, tablet, etc.