I have:
<?php previous_posts_link(' '); ?> -> <a href="http://example.com/path"> </a>
I need:
<?php previous_posts_link(' '); ?> -> <a href="/path"> </a>
I have: <?php previous_posts_link(‘ ‘); ?> -> <a href=http://example.com/path> </a> I need: <?php previous_posts_link(‘
Share
WordPress by default uses absolute URLs.
You can create a filter that hooks to
get_pagenum_linkand change the link:Alternatively you can, by using an output buffer, catch the whole pages output and change links according to your needs inside the buffer.
DOMDocumentandDOMXPathare helpful here. Another helpful library isNet_URL2, useful functions areparse_urlandhttp_build_url.