I found out that the pattern code was in the header.php of my judgment topic folder, and the author of this topic did not write code for products or product category pages, so I added
elseif (is_single() && get_post_type() == 'product'){ $posts_page_id = get_option('page_for_posts'); $posts_page_url = get_permalink($posts_page_id); echo '<li>';$bar = "shopping"; if(get_option_tree('blog_name', '', false)) /*$bar=get_option_tree('blog_name', '', false);*/ echo "<a href=".home_url()."/shopping/>$bar</a></li>"; echo "<li>"; the_title(); echo"</li>"; }
and for product category page
if (is_tax()) { $posts_page_id = get_option('page_for_posts'); $posts_page_url = get_permalink($posts_page_id); echo '<li>';$bar = "Shopping"; if(get_option_tree('blog_name', '', false)) echo "<a href=".home_url()."/shopping/>$bar</a> > </li>" ; echo "<li>"; woocommerce_page_title(); echo"</li>";}
I commented on the line that gets the name blog_name, because I use a custom page for my store, and not the default for woocommerce. I donβt know if there is another way to do this, but I notice that most of the code in this topic is not very professional even in css widgets, it was a bad choice.
source share