Many WordPress ‘template functions’ also have a corresponding ‘get_’ so in this case get_next_posts_link.
See the line number 1113 area of wp-includes/link-template.php in version 2.7.1
Thread Starter
yots
(@yots)
Thanks but it doesn’t seem to be working. Here is the code so you get an idea of what I’m trying to do.
<link href="<?php get_next_posts_link(); ?>" id="arr-nav-right-link" />
I want the link to the next posts populate the href. Is this possible?
When I check the HTML source the href is empty. No link.
<link href="" id="arr-nav-right-link" />
Thread Starter
yots
(@yots)
I tried doing:
<?php echo get_next_posts_link(); ?>
But it returns the entire link with an . All I need is the URL.
Look at the code in wp-includes/link-template.php looks like it eventually uses next_posts( $max_page, false ) at line 1099
Thread Starter
yots
(@yots)
Michael thanks! That worked! Why isn’t this documented on the Template Tags page?
Thread Starter
yots
(@yots)
Michael, this works for generating the pages urls, but on the a single post page it doesn’t generate a url for the next post. Is there a separate function for that?