#54281 closed defect (bug) (invalid)
wp_fanzone_breadcrumb bug
Reported by: | karimharo | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Hello
you used foreach loop but the variable output is overwritten and the echo is only showing the last path, so all parent pages are not shown in the breadcrumb
indeed in functions.php
} elseif (is_page()) { if($post->post_parent){ $fanzone_act = get_post_ancestors( $post->ID ); $title = get_the_title(); foreach ( $fanzone_act as $fanzone_inherit ) { $output = '<li><a href="'.get_permalink($fanzone_inherit).'" title="'.get_the_title($fanzone_inherit).'">'.get_the_title($fanzone_inherit).'</a></li> <li class="separator">/</li>'; } echo $output;
a potential fix is (but limitation with variable size ) :
} elseif (is_page()) { if($post->post_parent){ $fanzone_act = get_post_ancestors( $post->ID ); $title = get_the_title(); $output=""; foreach ( $fanzone_act as $fanzone_inherit ) { $output = '<li><a href="'.get_permalink($fanzone_inherit).'" title="'.get_the_title($fanzone_inherit).'">'.get_the_title($fanzone_inherit).'</a></li> <li class="separator">/</li>' . $output; } echo $output;
that keeps the right order of ancestors
BR
Karim
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi and welcome to WordPress Trac!
This is not a core problem; it's in the WP FanZone theme. Thank you for reporting this already on their support forum, where it belongs.
https://wordpress.org/support/topic/wp_fanzone_breadcrumb-issue/