WordPress.org

Ready to get started?Download WordPress

Forums

Ambrosite Next/Previous Page Link Plus
[resolved] Force Previous and Next and Remove Vertical Bar (4 posts)

  1. l7world.com
    Member
    Posted 1 year ago #

    Can you force Previous and Next to appear like First and Last? (if not please add)

    Can you get vertical bar "|" to disappear with links on irrelevant page (i.e.; parent page, which is only place holder)

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

  2. l7world.com
    Member
    Posted 1 year ago #

    Okay I figured out 2nd part:
    'format' => '%link » | ',
    (had vertical bar outside quote)

    Still wanna make the previous and next links mandatory for consistency.

  3. l7world.com
    Member
    Posted 1 year ago #

    Thanks for help me! You're welcome me.

    Figured it out, I was having trouble with array and if statements meant to keep navigation off parent which is placeholder. Also made first and last inactive when those pages are loaded.

    Here's result and code maybe it'll save someone some time

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <a href="http://l7world.com/webcomics/smurfmen">http://l7world.com/webcomics/smurfmen</a>
    "First | Previous | Next | Last"
    
    <?php if ( is_page (218) )  {
    } elseif (!previous_post_link_plus( array(
    'order_by' => 'post_date',
    'order_2nd' => 'post_date',
    'meta_key' => '',
    'loop' => false,
    'end_page' => 'fixed',
    'thumb' => false,
    'max_length' => 0,
    'format' => '%link | ',
    'link' => 'First',
    'date_format' => '',
    'tooltip' => '%title',
    'in_same_parent' => false,
    'in_same_author' => false,
    'in_same_meta' => 'webcomics',
    'ex_pages' => '',
    'in_pages' => '',
    'before' => '',
    'after' => '',
    'num_results' => 1,
    'return' => ''
    ) ) ) {
    echo 'First | '; } ; ?>
    <?php if ( is_page (218) )  {
    } elseif (!previous_post_link_plus( array(
    'order_by' => 'post_date',
    'order_2nd' => 'post_date',
    'meta_key' => '',
    'loop' => false,
    'end_page' => false,
    'thumb' => false,
    'max_length' => 0,
    'format' => '%link | ',
    'link' => 'Previous',
    'date_format' => '',
    'tooltip' => '%title',
    'in_same_parent' => false,
    'in_same_author' => false,
    'in_same_meta' => 'webcomics',
    'ex_pages' => '',
    'in_pages' => '',
    'before' => '',
    'after' => '',
    'num_results' => 1,
    'return' => ''
    ) ) ) {
    echo 'Previous | '; } ; ?>
    <?php if ( is_page (218) )  {
    } elseif (!next_post_link_plus( array(
    'order_by' => 'post_date',
    'order_2nd' => 'post_date',
    'meta_key' => '',
    'loop' => false,
    'end_page' => false,
    'thumb' => false,
    'max_length' => 0,
    'format' => '%link | ',
    'link' => 'Next',
    'date_format' => '',
    'tooltip' => '%title',
    'in_same_parent' => false,
    'in_same_author' => false,
    'in_same_meta' => 'webcomics',
    'ex_pages' => '',
    'in_pages' => '',
    'before' => '',
    'after' => '',
    'num_results' => 1,
    'return' => ''
    ) ) ) {
    echo 'Next | '; } ; ?>
    <?php if ( is_page (218) )  {
    } elseif (!next_post_link_plus( array(
    'order_by' => 'post_date',
    'order_2nd' => 'post_date',
    'meta_key' => '',
    'loop' => false,
    'end_page' => 'fixed',
    'thumb' => false,
    'max_length' => 0,
    'format' => '%link | ',
    'link' => 'Last',
    'date_format' => '',
    'tooltip' => '%title',
    'in_same_parent' => false,
    'in_same_author' => false,
    'in_same_meta' => 'webcomics',
    'ex_pages' => '',
    'in_pages' => '',
    'before' => '',
    'after' => '',
    'num_results' => 1,
    'return' => ''
    ) ) ) {
    echo 'Last '; } ; ?>
  4. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that is exactly what I would have suggested -- checking the return value of the function in an 'if' statement. I also have sample code for that in the plugin documentation. I am marking this thread as resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.