Title: reverse parents term array
Last modified: August 21, 2016

---

# reverse parents term array

 *  [alhoseany](https://wordpress.org/support/users/alhoseany/)
 * (@alhoseany)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/reverse-parents-term-array/)
 * hi, i do not know if this is an error or not. i found that the plugin provide
   my term taxonomy parents backwards. like this:
    – lips — lips makeup — glossy
   lips
 * is rendered like this:
    / lips makeup / lips / glossy lips
 * i search through code and i found these lines from breadcrumb-trail\inc\breadcrumbs.
   php line 983
 *     ```
       /* If we have parent terms, reverse the array to put them in the proper order for the trail. */
       		if ( !empty( $parents ) ){
       			$this->items = array_merge( $this->items, $parents );
       			}
       ```
   
 * i changed it to this and it fixed my problem:
 *     ```
       /* If we have parent terms, reverse the array to put them in the proper order for the trail. */
       		if ( !empty( $parents ) ){
       		$parents = array_reverse($parents); // added line
       			$this->items = array_merge( $this->items, $parents );
       			}
       ```
   
 * i hope this will help someone.
    thanks for this great plugin
 * [http://wordpress.org/plugins/breadcrumb-trail/](http://wordpress.org/plugins/breadcrumb-trail/)

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

 *  [Promaetheus](https://wordpress.org/support/users/promaetheus/)
 * (@promaetheus)
 * [12 years ago](https://wordpress.org/support/topic/reverse-parents-term-array/#post-4402026)
 * Thank you very much! This fixed the bug!
 *  [tdmalone](https://wordpress.org/support/users/tdmalone/)
 * (@tdmalone)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/reverse-parents-term-array/#post-4402043)
 * Just found this too and came here to report it before I saw it has already been
   reported 🙂 Would love for this to be fixed in a future version so we don’t need
   to reapply the fix after updating the plugin!
 *  [N-Z](https://wordpress.org/support/users/n-z/)
 * (@n-z)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/reverse-parents-term-array/#post-4402044)
 * Heh, I fixed it in my download, too – prepared a long writeup and then was amazed,
   startled and totally confused that I saw my exact change in the now-current download
   with the version number I just had modified.
 * I did essentially the same… but only changed
    $this->items = array_merge( $this-
   >items, $parents ); into $this->items = array_merge( $this->items, array_reverse(
   $parents) ); as the currently available download seems to be doing now(?!).

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

The topic ‘reverse parents term array’ is closed to new replies.

 * ![](https://ps.w.org/breadcrumb-trail/assets/icon-256x256.png?rev=1256005)
 * [Breadcrumb Trail](https://wordpress.org/plugins/breadcrumb-trail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/breadcrumb-trail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/breadcrumb-trail/)
 * [Active Topics](https://wordpress.org/support/plugin/breadcrumb-trail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/breadcrumb-trail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/breadcrumb-trail/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [N-Z](https://wordpress.org/support/users/n-z/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/reverse-parents-term-array/#post-4402044)
 * Status: not resolved