Modify php code to pass a page id as a parameter in order to create a breadcrumb
I simply had to remove ‘is_page() && ‘ in both the if and the elseif function the_ajax_breadcrumb($post_id) { ob_start(); $args = array(‘page_id’ => $post_id); $the_query = new WP_Query($args); $currentBefore=”<li><a>”; $currentAfter=”</a></li>”; while ( $the_query->have_posts() ) { $the_query->the_post(); if ( !is_home() && !is_front_page() || is_paged() ) { echo ‘<nav class=”breadcrumb”><ul>’; if ( !$the_query->post->post_parent ) { echo $currentBefore; … Read more