Forums
Forums / Fixing WordPress / Next Post Link Function
(@tristanmarsh)
11 years, 4 months ago
Hi there,
I’m trying to insert a next post link, with the default title and limited to the category taxonomy.
I’ve tried the codex page
But I am having trouble limiting the category and having the title show up as the actual post title. Code used;
<?php next_post_link( $format, '%title', $in_same_term = true); ?>
Could I please get some assistance, or more importantly a reference to how to use the php arguments properly?
Thanks
(@catacaustic)
You haven’t defined $format there, so unless this is set somewhere, that’s a problem. You also haven’t defined the parameter for $in_same_term the right way.
$format
$in_same_term
You’d need to use something like this:
<?php next_post_link( '%link »', '%title', true ); ?>
The topic ‘Next Post Link Function’ is closed to new replies.