0

Hi,

Having a bit of trouble with breadcrumbs in Wordpress, the theme has the breadcrumbs feature enabled but only includes the object page and the homepage, I want to add the parent page into the breadcrumbs.

Here is the code:

<div id="breadcrumbs">
    <?php if(function_exists('bcn_display')) { bcn_display(); }
          else { ?>
                <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e('Home','Aggregate') ?></a> <span class="raquo">&raquo;</span>

                <?php if( is_tag() ) { ?>
                    <?php esc_html_e('Posts Tagged ','Aggregate') ?><span class="raquo">&quot;</span><?php single_tag_title(); echo('&quot;'); ?>
                <?php } elseif (is_day()) { ?>
                    <?php esc_html_e('Posts made in','Aggregate') ?> <?php the_time('F jS, Y'); ?>
                <?php } elseif (is_month()) { ?>
                    <?php esc_html_e('Posts made in','Aggregate') ?> <?php the_time('F, Y'); ?>
                <?php } elseif (is_year()) { ?>
                    <?php esc_html_e('Posts made in','Aggregate') ?> <?php the_time('Y'); ?>
                <?php } elseif (is_search()) { ?>
                    <?php esc_html_e('Search results for','Aggregate') ?> <?php the_search_query() ?>
                <?php } elseif (is_single()) { ?>
                    <?php $category = get_the_category();
                          $catlink = get_category_link( $category[0]->cat_ID );
                          echo ('<a href="'.esc_url($catlink).'">'.esc_html($category[0]->cat_name).'</a> '.'<span class="raquo">&raquo;</span> '.get_the_title()); ?>
                <?php } elseif (is_category()) { ?>
                    <?php single_cat_title(); ?>
                <?php } elseif (is_author()) { ?>
                <?php
                    global $wp_query;
                    $curauth = $wp_query->get_queried_object();
                    esc_html_e('Posts by ','Aggregate'); echo ' ',$curauth->nickname;
                ?>
                <?php } elseif (is_page()) { ?>
                    <?php wp_title(''); ?>
                <?php }; ?>
    <?php }; ?>
</div> <!-- end #breadcrumbs -->

Thanks

3
Contributors
3
Replies
32
Views
3 Years
Discussion Span
Last Post by ko ko
0

seotheo: Here is reference from WP Codex for you. Check it out and try this inside is_paged() conditional block properly as you need.

Always check WP Codex while working with WordPress.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.