baal666
Member
Posted 3 weeks ago #
Hi,
I'd like to get a link to a particular #marker somewhere on the page when people are trying to access my previous posts. How can it be done?
I tried:
<a href="#marker"><?php next_posts_link('« Billets précédents') ?></a>
and
<?php next_posts_link('<a href="#marker">« Billets précédents</a>') ?>
but it was a failure.
Any idea?
Thanks
Could use get_next_posts_link then use str_replace to put that marked in the link the use echo to display the link.
Also could modify the function get_next_posts_link in wp-includes/link-template.php but modifying core code is discouraged.
Then again there might be a filter for that but darned if I can see it...
baal666
Member
Posted 3 weeks ago #
Hmmm... I'm kind of a newbie... Any easier way to integrate a # marker?
Not unless you can find a plugin.
Maybe wp-pagenavi has something. http://wordpress.org/extend/plugins/wp-pagenavi/
baal666
Member
Posted 3 weeks ago #
I hate plugins; they slow down my blog so much.
baal666
Member
Posted 3 weeks ago #
How would you use str_replace to idenfify a # marker in the next page?
Actually get_next_posts_link returns a link such as this:
<a href="http://sample.com/?paged=3" >« Older Entries</a>
So you want to link to look like?
baal666
Member
Posted 3 weeks ago #
Hmmm... Not sure to understand. Whay I need is to relate to the next page but at a particular place in that page, on the place.
but at a particular place in that page
Ah I got you. But, the next page is a series of posts so every next/previous page will have a different set of posts.
baal666
Member
Posted 3 weeks ago #
Yes, I understand that, but I want to put a # marker on them so it will show the right place.
Okay, then put the marker in place and type the URL in your browser that goes to that marker then report that URL back here.