Ambrosite Next/Previous Post Link Plus
[resolved] return only permalink url (4 posts)

  1. kristinachilds
    Posted 3 years ago #

    Thank you so much for this plugin. I had been searching for a way to page through the posts alphabetically for a while now.

    My ultimate goal is to have a "« BACK | NEXT »" nav on all single page posts within a certain category. I tried using the return => 'href' parameter to return just the url, but that returned nothing at all. in fact, none of the return parameters i tried worked. Can you tell me how to get the "back" and "next" text displayed on screen rather than the post title? Here is what I am currently running with:

    <a href="<?php previous_post_link_plus( array( 'order_by' => 'post_title','in_same_cat' => true ,'return' => 'href' ) ); ?>" style="color: #000;">&laquo; BACK</a> |
    <a href="<?php next_post_link_plus( array( 'order_by' => 'post_title','in_same_cat' => true ,'return' => 'href' ) ); ?>">NEXT &raquo;</a>


  2. ambrosite
    Plugin Author

    Posted 3 years ago #

    The 'href' parameter returns the link as a PHP string, so you would need add an echo in front of the function calls in order to print it to the screen.

    However if all you are trying to do is title your links 'BACK' and 'NEXT', you don't need the href parameter at all. Use the 'link' parameter to format your link, like this:

    <?php previous_post_link_plus( array( 'order_by' => 'post_title', 'in_same_cat' => true, 'link' => 'BACK' ) ); ?>  |
    <?php next_post_link_plus( array( 'order_by' => 'post_title', 'in_same_cat' => true, 'link' => 'NEXT' ) ); ?>
  3. kristinachilds
    Posted 3 years ago #

    I just knew there had to be a way to change out the content of the link text! Thanks so much... It wasn't entirely clear in the documentation... at least for someone who is fairly new to php :)

  4. ambrosite
    Plugin Author

    Posted 3 years ago #

    I'm glad to hear it's working for you. :) I am marking this thread resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ambrosite Next/Previous Post Link Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic