I want to use something like previous_post_link('%link','',TRUE )
and put the path into a javascript variable.
So using something like
var previous = "<?php previous_post_link( '%link','',TRUE ); ?>";
outputs :
<a href="http://www.website.com/photo/1085" rel="prev"></a>
but instead I only want the path output in that variable.
http://www.website.com/photo/1085
I like this function because it allows you to remain in category so I am hoping for a solution where I still can easily have that as an option.
Add following function in your functions.php file.
and instead of calling previous_post_link(‘%link’,”,TRUE ) function call it as custom_post_link(‘%link’,”,TRUE ) and it will output the path as following