0
I need to generate a button for the next post in the category and am using the following code
<?php next_post_link('%link','<span class="button-1">%title</span>',TRUE); ?>
But it includes posts from other categories even setting the $in_same_term parameter as TRUE and excluding other categories with the $excluded_terms parameter, modifying these parameters has no effect on the generated link, only the $format and $link parameters work.
I inserted this code into a content-news.php file which is called within the single.php.
Have you tried <?php next_post_link( '%link', 'Next post in Category', TRUE, '13' ); ? > replacing the 13 pe id of the category, also try this way but without the id of the category
– Fabiano Cacin Pinel
That’s because
wordpress
is a great XGH user of global.– Guilherme Lautert
I tried, the link doesn’t appear.
– Elder Carvalho