• Hello everyone –

    Working on a very vexing issue involving breadcrumbs in a particular theme that uses custom post types. The developer is very slow in responding and often doesn’t understand the issue.

    So the custom post type is ‘services.’ And the breadcrumbs look like this:

    Home > Service > Some Page

    However, I’ve changed the category/slug of the custom post type so each ‘service’ page has a unique name, and if the breadcrumbs followed the navigation menu, they should appear like this:

    Home > Unique > Some Page
    Home > Unique2 > Some Page
    Home > Unique3 > Some Page

    But the breadcrumbs won’t follow the menu structure and I still get this on every custom post type page:

    Home > Service > Some Page

    The breadcrumbs code lives in a file called custom.php and looks like this:

    \
    function logitrans_breadcrumb() {
    echo ‘<div class=”breadcrumbs”><p>’;
    esc_html_e(“You Are Here : “, ‘logitrans’);

    if (!is_home()) {
    echo ‘<span><a href=”‘;
    echo esc_url( home_url( ‘/’ ) );
    echo ‘”>’; ?>
    <?php esc_html_e( ‘Home’, ‘logitrans’ ); ?>
    <?php echo ‘</span><span class=”arrow”><i class=”icon icon-arrow-right”></i></span>’;
    if (is_category() || is_singular(‘post’)) {
    echo ‘<span>’;
    the_category(‘ </span><span> ‘);
    if (is_single()) {
    echo ‘</span><span class=”arrow”><i class=”icon icon-arrow-right”></i></span><span>’;
    the_title();
    echo ‘</span>’;
    }
    } elseif (is_page()) {
    echo ‘<span>’;
    echo the_title();
    echo ‘</span>’;
    }
    elseif (‘logitrans-service’ == get_post_type()) {
    echo ‘<span>’; ?>
    <?php esc_html_e( ‘Service’, ‘logitrans’ ); ?>
    <?php
    echo ‘</span><span class=”arrow”><i class=”icon icon-arrow-right”></i></span><span>’;
    the_title();
    echo ‘</span>’;
    }
    }
    elseif (is_tag()) {single_tag_title();
    }
    elseif (is_author()) { ?><span><?php esc_html_e( ‘Author Archive”‘, ‘logitrans’ ); echo'</span>’;
    }
    elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?><span><?php esc_html_e( ‘Blog Archives’, ‘logitrans’ ); echo'</span>’;
    }
    elseif (is_search()) { ?><span><?php esc_html_e( ‘Search Results’, ‘logitrans’ ); echo'</span>’;
    }
    echo ‘</p></div>’;
    }
    \

    My attempts to modify or replace the code results in pages not loading. I’m about at the end of my rope here. Can someone please help?

    Thanks you in advance.

  • The topic ‘bypassing custom post type category in breadcrumbs’ is closed to new replies.