Is there a way to allow post navigation buttons (at the bottom of the post content) to only be visible to a certain category?
Basically, I’m using one of the post categories exclusively for the home page slider and another one for articles; such post navigation buttons would only make sense in article pages. Is there a way to solve this?
This code will hide post navigation on all posts except “featured” category. You can target other categories by modifying code based on what categories you are using on your website. So this code won’t work by default and you need to use your own categories from your own website.
I’ve adjusted the CSS code. So currently whenever I’m at a post page, post navigation is only visible if the post presented belongs to the category I’ve defined in the CSS code. But I still have an issue. If the “next”/“previous” post is from a different category, the navigation link will still appear - is there a way to hide a post navigation link based on its destination (aka category it belongs to).
To make post navigation button to work within the same category only you need to specify it for previous_post_link function that you can see defined inside template-tags.php file that you can find in Sparkling folder >> inc.
Here you can read more about previous_post_link function and how you should modify it. The same approach you should use for next_post_link.
Basically you just need to add ,TRUE before the closing brackets for each function.
Hello.
I’m using Sparkling theme.
How I can remove " Post navigation " h1 tag?
H1 tag is very important for SEO , But there is this problem in the template.
Thank you.
@webhosting This is old topic and to help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/sparkling/ instead of replying on others thread as it makes the thread messy and hard to read.
If you want to you can also add reference of this thread in your newly created thread.
We would be more than happy to help you on your new thread.