WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Ambrosite Next/Previous Post Link Plus] return only permalink url

[Resolved] [Plugin: Ambrosite Next/Previous Post Link Plus] return only permalink url

  • kristinachilds
    Member

    @kristinachilds

    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>

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ambrosite
    Participant

    @ambrosite

    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' ) ); ?>

    kristinachilds
    Member

    @kristinachilds

    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 ๐Ÿ™‚

    Plugin Author ambrosite
    Participant

    @ambrosite

    I’m glad to hear it’s working for you. ๐Ÿ™‚ I am marking this thread resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Ambrosite Next/Previous Post Link Plus] return only permalink url’ is closed to new replies.