Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1465443

    How to change the code so that the blog post breadcrumbs focuses on the main blog URL and not the blog categories?

    #1465462

    Hey menainfosec,

    Thank you for the inquiry.

    What do you mean by “focuses on the main blog URL”? Could you please elaborate or provide an example of the breadcrumb trail you wish to implement? If you want to customize the breadcrumb trail, you can use the avia_breadcrumbs_trail filter as shown in the following threads:

    // https://kriesi.at/support/topic/breadcrumb-not-to-display-single-product-titles/#post-1464337
    // https://kriesi.at/support/topic/breadcrumb-not-to-display-single-product-titles/#post-1464096

    Best regards,
    Ismael

    #1465559

    I want to change the breadcrumb trail from “Home > Primary Blog Category > Blog sub-category > Blog post” to “Home > Main blog URL > Blog post” Is this possible?
    My main blog URL and my primary blog category URL are different.

    #1465634

    Hi,

    Thank you for the update.

    You can try this filter in the functions.php file:

    function avia_breadcrumbs_trail_mod($trail) {
        if (is_singular('post')) {
            unset($trail[1]);
            unset($trail[2]);
            $end = $trail['trail_end'];
            unset($trail['trail_end']);
    
            $trail[] = '<a href="' . home_url('/blog') . '" title="Blog" rel="">Blog</a>';
            $trail[] = $end;
        }
    
        return $trail;
    }
    add_filter('avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 1);

    Best regards,
    Ismael

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