→→ Please check out our new WP Theme: Navian - Responsive Multi-Purpose WordPress Theme ←←
- In case you can't login to submit a ticket, please hard refresh the browser and try again.
If the problem persists, please submit your questions via THEMELOGI profile page instead.

- Regrading the plugin activation, please have a look at Bundled Plugin License information.
- If you couldn't import demo content or you got the message "Failed to import", please see our FAQs page. Thank you :)
- We've updated the theme to be compatible with latest WordPress version, please update your theme as in the article here

Tickets Tickets Navian Breadcrumbs problem

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #10206

    Hi,
    How can I change breadcrumbs in blog posts.
    Now I have:
    Home > Blog > article title
    but I would like to have:
    Home > Blog > categoryname > articletitle
    thanks

    #10212
    Danny
    Supporter

    Hi there,

    Thanks for writing in!

    To resolve this issue, please open up the helpers.php in themes/navian/inc folder, find the code below (around line 763) :

    $breadcrumb .= '<li><a href="' . esc_url( get_permalink( get_option( 'page_for_posts' ) ) ) . '">' . esc_html( get_option( 'tlg_framework_blog_title', esc_html__( 'Our Blog', 'navian' ) ) ) . '</a></li><li class="active">' . esc_html( get_the_title( $post->ID ) ) . '</li>';

    … and change it into this:

    $breadcrumb .= '<li><a href="' . esc_url( get_permalink( get_option( 'page_for_posts' ) ) ) . '">' . esc_html( get_option( 'tlg_framework_blog_title', esc_html__( 'Our Blog', 'navian' ) ) ) . '</a></li>'.get_the_term_list($post->ID, 'category', '<li>', '&nbsp;&nbsp;/&nbsp;&nbsp;', '</li>').'<li class="active">' . esc_html( get_the_title( $post->ID ) ) . '</li>';

    Then please add the code below to your Dashboard > Appearances > Customize > Fonts & CSS > Custom CSS:

    .image-bg .single-post .breadcrumb-style li a {color: #fff!important;}
    .image-bg .single-post .breadcrumb-style li a:hover, .single-post .breadcrumb-style li a, .single-post .breadcrumb-style li, .single-post .breadcrumb-style li a:hover {background: transparent!important;border: none!important; margin: 0;padding: 0!important;color: rgba(255,255,255,0.9)!important;}

    Hope this helps,
    Danny

    #10760

    Hi.
    In the breadcrumbs I’d like to get the primary category of a post only, in order to have:

    Home > Blog > “primary category”

    and not a list of categories separated by /.
    Is that possible?
    Thanks

    #10763
    Danny
    Supporter

    Hi there,

    Thanks for writing in!

    To get the first category only in the breadcrumb, please change the code above into this:

    $category_link = '';
    $category = get_the_category($post->ID);
    if ( ! empty( $category ) ) {
    	$category_link = '<li><a href="' . esc_url( get_category_link( $category[0]->term_id ) ) . '">' . esc_html( $category[0]->name ) . '</a></li>';
    }
    $breadcrumb .= '<li><a href="' . esc_url( get_permalink( get_option( 'page_for_posts' ) ) ) . '">' . esc_html( get_option( 'tlg_framework_blog_title', esc_html__( 'Our Blog', 'navian' ) ) ) . '</a></li>'.$category_link.'<li class="active">' . esc_html( get_the_title( $post->ID ) ) . '</li>';

    Hope this helps,
    Danny

    #10820

    Hi, I´ve got this problem, but in woocommerce,
    My breadcrums only sow “Home | Shop | product” and I need to show “Home | Shop | category | sub category |….| product”
    How can I do this? I´ve install yoast seo and other pluggins and nothing works, thanks for your help

    #10824
    Danny
    Supporter

    Hi there,

    Thanks for writing in!

    To resolve this issue, please open up the helpers.php in themes/navian/inc folder, find the code below (around line 775) :

    $breadcrumb .= $product_cat.'<li class="active">' . esc_html( get_the_title( $post->ID ) ) . '</li>';

    … and change it into this:

    $product_cat = '';
    if ('product' == $post_type && is_single()) {
    	$term_list = wp_get_post_terms($post->ID,'product_cat');
    	if (!empty($term_list)) {
    		$product_cat = '<li><a href="' . esc_url( get_term_link ($term_list[0]->term_id, 'product_cat') ) . '">' . esc_html( $term_list[0]->name ) . '</a></li>';
    	}
    }
    $breadcrumb .= $product_cat.'<li class="active">' . esc_html( get_the_title( $post->ID ) ) . '</li>';

    We’ll consider to add this feature as an option in next theme updates.

    Hope this helps,
    Danny

    #10829

    Thank you very much for the answer, but only the immediate previous category appears, not all the subcategories, example
    home | shop | category father | sub category 1 | sub category 2 | product
    I am missing the parent category and sub category 1, the indiata to the product already appears, thank you very much in advance for helping me

    #10830
    Danny
    Supporter

    Hi there,

    Thanks for your info!

    In this case, please change the code above into this:

    $product_cat = '';
    if ('product' == $post_type && is_single()) {
    	$term_lists = wp_get_post_terms($post->ID,'product_cat');
    	if (!empty($term_lists)) {
    		foreach ($term_lists as $term_list) {
    			$product_cat .= '<li><a href="' . esc_url( get_term_link ($term_list->term_id, 'product_cat') ) . '">' . esc_html( $term_list->name ) . '</a></li>';
    		}
    	}
    }
    $breadcrumb .= $product_cat.'<li class="active">' . esc_html( get_the_title( $post->ID ) ) . '</li>';

    Also, if you like our theme and the support, please consider to leave us a 5-star review rating for the theme via ThemeForest > Downloads section. It helps us a lot!

    Best regards,
    Danny

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.