Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #191806

    I use Woocommerce as shop and have setup a page as shop page – it calls shop. If I call a subpage like product category or a keyword page, I do have in the breadcrumb the top link to page “shop” twice. I am not shure, were it comes from. I setup permalinks like this:

    product category base: shop
    product keyword base: productkeyword
    and under user defined product-permalink base: /shop

    All URLs are fine except in the breadcrumbs only I do have this behavior. I checked my wpSEO plugin too, but did not find any reason for this.

    Any help welcome.

    #191983

    Hey adrianwackernah!

    And both ‘shops’ are linking to the same page?

    Cheers!
    Josue

    #191988

    Yes, Josue

    #192849

    Hi!

    Please create us an admin account and post the login credentials as private reply – we’ll look into it.

    Cheers!
    Peter

    #192859
    This reply has been marked as private.
    #193315

    Hey!

    I can’t modify the theme files and thus I can’t debug the issue. We need to know how the breadcrumb trail look like. Insert following code into the theme functions.php file

    
    if(!function_exists('avia_modify_event_breadcrumb'))
    {
        function avia_modify_event_breadcrumb($trail)
        {
            print_r($trail);
            return $trail;
        }
    
        add_filter('avia_breadcrumbs_trail','avia_modify_event_breadcrumb');
    }
    

    and Enfold should output some new text/code at the very top of the page (i.e. here: http://bildmanufaktur-wackernah.de/shop/ebooks/ ). Please copy it and post it in this thread.

    Best regards,
    Peter

    #193320

    Hi Peter, I got this returned:

    Array ( [0] => Startseite [1] => Shop [trail_end] => eBooks )

    #193326

    Hi Peter, I pasted the code snipped first at very top of the functions.php at line 15. Than I moved the code from very top to near the end of the function.php at line 415 and now I got this output:

    Array ( [0] => Startseite [1] => Shop [2] => Shop [3] => eBooks )

    #193329

    Hi!

    Ok, now try to insert following code instead

    
    if(!function_exists('avia_modify_event_breadcrumb'))
    {
        function avia_modify_event_breadcrumb($trail)
        {
            foreach($trail as $key => $data)
            {
                if(strpos($data,'href="http://bildmanufaktur-wackernah.de/shop/"') !== false) unset($trail[$key]);
            }
            return $trail;
        }
    
        add_filter('avia_breadcrumbs_trail','avia_modify_event_breadcrumb');
    }
    

    Does it solve the issue?

    Cheers!
    Peter

    #193331

    I pasted it again at line 415 and now the “shop” is completely removed from the breadcrumb.

    Sie befinden sich hier:Startseite / eBooks

    It is not solved.

    #193332

    Hi!

    Yes, I just read your last post – try following code instead

    
    if(!function_exists('avia_modify_event_breadcrumb'))
    {
        function avia_modify_event_breadcrumb($trail)
        {
    		$urls = array();
            foreach($trail as $key => $data)
            {
            	if(in_array($data, $urls))
            	{
            		unset($trail[$key]);
            	}
            	else
            	{
            		$urls[] = $data;
            	}
            }
            return $trail;
        }
    
        add_filter('avia_breadcrumbs_trail','avia_modify_event_breadcrumb');
    }
    

    Regards,
    Peter

    #193335

    Yes, it is solved, Peter. Thanks.

    But what is the reason for this? Does it affect all users of woocommerce? Do I have to put that code into functions.php after each upgrade of Enfold?

    #193340

    Hey!

    You can also put it into your child theme – then you don’t need to modify functions.php every time you update the theme.

    But what is the reason for this? Does it affect all users of woocommerce?
    No, afaik you’re the first user who reported this issue – that’s why I had to debug the breadcrumb output first. It seems like wordpress adds the same page id (shop page) to your breadcrumb several times but I’m not sure why. Maybe a third party plugin causes the issue or it’s a configuration issue with the WooCommerce shop page but I’m not sure. I’ll monitor the support forum and if more users report the same issue we’ll check the code of our breadcrumb function.

    Best regards,
    Peter

    #193343

    OK, thats a good idea, trying child themes for the first time for me.

    I will look into this over the time if I upgrade Enfold or plugins and if it appears again without that code snippet.

    Thanks again and best regards, Adrian

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Pagelink in Breadcrumb twice’ is closed to new replies.