I have come across a problem whilst using the next_post_link() function. It seems that this function automatically echo's, for position reasons I need this to just return the link. Is there any available function or workaround that I can use to achieve this result?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
try to work with http://codex.wordpress.org/Function_Reference/get_adjacent_post; example:
|
|||
|
|
If you take a look at the source, Unfortunately, this function doesn't take any form of 'echo' parameter, so you'll either need to replicate the code in your own function & return the value, or catch it in an output buffer;
|
|||
|
|
|
Actually, yes: just use The EDIT Erm, nevermind. I mis-read the function name. You could use
|
||||
|
|
