Title: Possible bug on the &quot;loop&quot; parameter
Last modified: August 21, 2016

---

# Possible bug on the "loop" parameter

 *  [Overflow](https://wordpress.org/support/users/acrane/)
 * (@acrane)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/)
 * First off, amazing plugin. But I may have found a possible glitch.
 * I have a bunch of projects (Custom Post Type) That each have a Custom Taxonomy.
   I have about 8 Terms in the Custom Taxonomy. Set up exactly like Categories to
   a post.
 * The idea is that they can just keep clicking “Next Project” and they will just
   view the next project with the same category. It works perfectly on all categories
   except for one. Doesn’t matter which category, as long as it’s the last published
   project. Then, instead of looping back to the first project in that category,
   it loops back to the earliest published project no matter what category it’s 
   in.
 * What am I missing? You can see this in action [here](http://optima.bellaworksweb.net/projects/data-chambers-data-center-expansion/)
   and just click the next project link.
 * (i know i mixed up “category” and my custom tax, but i’m sure you get the idea.)
 * [http://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/](http://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [ambrosite](https://wordpress.org/support/users/ambrosite/)
 * (@ambrosite)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/#post-4344349)
 * Which options are you using? Please post your code here so I can see how the 
   parameters are set.
 *  Thread Starter [Overflow](https://wordpress.org/support/users/acrane/)
 * (@acrane)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/#post-4344469)
 * Thanks. I’ve tried to play around with a few parameters, but this is the current
   version. (Some are commented out)
 *     ```
       <?php  next_post_link_plus( array(
   
       	'order_by' => 'post_date',
       	/*'order_2nd' => 'post_date',*/
       	'meta_key' => '',
       	'post_type' => '',
       	'loop' => true,
       	'end_post' => false,
       	'thumb' => false,
       	'max_length' => 0,
       	'format' => '%link &raquo;',
       	'link' => 'Next Project',
       	'date_format' => '',
       	'tooltip' => '%title',
       	'in_same_cat' => true,
       	'in_same_tax' => true,
       	/*'in_same_format' => false,
       	'in_same_author' => false,
       	'in_same_meta' => false,*/
       	'ex_cats' => '',
       	/*'ex_cats_method' => 'weak',*/
       	'in_cats' => '',
       	'ex_posts' => '',
       	'in_posts' => '',
       	'before' => '',
       	'after' => '',
       	'num_results' => 1,
       	'return' => ''
   
                  ) ); ?>
       ```
   
 *  Plugin Author [ambrosite](https://wordpress.org/support/users/ambrosite/)
 * (@ambrosite)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/#post-4344518)
 * Any particular reason why you have both in_same_cat and in_same_tax set to true?
   If you are using a custom taxonomy then just use in_same_tax. You could also 
   try passing the name of your custom taxonomy:
 * ‘in_same_tax’ => ‘my_taxonomy’
 *  Thread Starter [Overflow](https://wordpress.org/support/users/acrane/)
 * (@acrane)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/#post-4344521)
 * Ok, I got rid of ‘in_same_cat’, no luck.
 * Then I tried to set a variable to find the term using
    `if (has_term('k-12-education','
   categories')) {$projDetails = "pro-det-k-12-single"; $myTax = 'k-12-education';}`
   ect…ect…
 * Then I put the variable in the ‘in_same_tax’ but it didn’t like that because 
   I’m assuming that it’s supposed to receive only a True/False? When I did, I got
   this error.
 * Warning: array_merge() [function.array-merge]: Argument #2 is not an array in/
   home/bwwnet/public_html/optima/wp-content/plugins/next-post-plus/ambrosite-post-
   link-plus.php on line 114
 * Thanks for the help so far. Hope we can figure this out.
 *  Plugin Author [ambrosite](https://wordpress.org/support/users/ambrosite/)
 * (@ambrosite)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/#post-4344522)
 * The in_same_tax parameter accepts the taxonomy name, not the term name. For example,
   the standard Category taxonomy is named ‘category’, the standard Tags taxonomy
   is named ‘post_tag’, and so on. If you are using a plugin to create your custom
   taxonomies, there should be a field somewhere in the admin that shows you the
   name.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Possible bug on the "loop" parameter’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ambrosite-nextprevious-post-link-
   plus.svg)
 * [Ambrosite Next/Previous Post Link Plus](https://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ambrosite-nextprevious-post-link-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/ambrosite-nextprevious-post-link-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ambrosite-nextprevious-post-link-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ambrosite-nextprevious-post-link-plus/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [ambrosite](https://wordpress.org/support/users/ambrosite/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/possible-bug-on-the-loop-parameter-1/#post-4344522)
 * Status: not resolved