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

    (@ambrosite)

    If you are talking about the num_results parameter, yes that was added to the plugin some time ago:

    <?php next_post_link_plus( array(
    'order_by' => 'post_title',
    'format' => '%link (category %category)',
    'link' => 'Next',
    'before' => '<h4>Next posts</h4><ul>',
    'after' => '</ul>',
    'in_same_cat' => true,
    'num_results' => 3
    ) );?>
    Thread Starter naloo

    (@naloo)

    hi, i didnt mean “num_results” i mean actually different next buttons on the same page, eg.

    next ‘in_same_cat’ = ‘abc’ | next ‘in_cats’ => ‘123’ | next ‘in_same_tax’ => ‘xyz’

    Plugin Author ambrosite

    (@ambrosite)

    If that’s what you want you can do it by calling the function three times in a row with different parameters.

    <?php next_post_link_plus( array(
    'format' => '%link (category %category)',
    'link' => 'Next',
    'in_same_cat' => 'abc'
    ) );?> |
    <?php next_post_link_plus( array(
    'format' => '%link (category %category)',
    'link' => 'Next',
    'in_cats' => '123'
    ) );?> |
    <?php next_post_link_plus( array(
    'format' => '%link (category %category)',
    'link' => 'Next',
    'in_same_tax' => 'xyz'
    ) );?>
    Thread Starter naloo

    (@naloo)

    but it isn’t working…

    ‘in_same_tax’ this gives me this error:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/httpd/vhosts/naloo.net/httpdocs/wp/wp-content/plugins/ambrosite-nextprevious-post-link-plus/ambrosite-post-link-plus.php on line 114

    Warning: array_unique() expects parameter 1 to be array, null given in /home/httpd/vhosts/naloo.net/httpdocs/wp/wp-content/plugins/ambrosite-nextprevious-post-link-plus/ambrosite-post-link-plus.php on line 114

    and if i try with different categories, it always renders the same result, you can look at it here: https://naloo.net/wp/3kh/

    it should get this:
    next > apollo-8
    logo > apollo-8
    print > apparence
    digital > bimi
    but all three next buttons go to apollo-8

    this is what the code looks like:

    <?php next_post_link_plus( array('order_by' => 'post_title', 'format' => '%link', 'link' => 'next', 'in_same_cat' => 'work' ) );?>
    
    <?php next_post_link_plus( array('order_by' => 'post_title', 'format' => '%link', 'link' => 'logo', 'in_same_cat' => 'ct-logo', 'ex_cats' => 'work', 'ex_cats_method' => 'weak' ) );?>
    
    <?php next_post_link_plus( array('order_by' => 'post_title', 'format' => '%link', 'link' => 'print', 'in_same_cat' => 'ct-print', 'ex_cats' => 'work', 'ex_cats_method' => 'diff' ) );?>
    
    <?php next_post_link_plus( array('order_by' => 'post_title', 'format' => '%link', 'link' => 'digital', 'in_same_cat' => 'ct-digital', 'ex_cats' => 'work', 'ex_cats_method' => 'strong' ) );?>

    Thread Starter naloo

    (@naloo)

    ahh, trial and error… i just found out! and it works, your plugin is sooo coool! thanks!

    ‘in_cats’ => ’22’, ‘ex_cats’ => ’11’, ‘ex_cats_method’ => ‘diff’
    was the solution

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘two or more next buttons with different settings’ is closed to new replies.