Good morning all,
I have a problem with WooComerce breadcrumbs. I want to add breadcrumbs bar with current page/product title on left side. But i have no idea how can I get this title. I was able to add some custom text and move it to right with this code:
'wrap_before' => '<nav class="woocommerce-breadcrumb"><h1 id="name">Some text</h1>',
'wrap_after' => '</nav>',
Can you please suggest me some solution to get the title?
EDIT: Okey i manage to get some temporary results but its return only WooComerce pages name (shop,category names) it dont show product names. Any suggestions ?
Here is code:
<script type='text/javascript'>
/* <![CDATA[ */
jQuery(document).ready(function() {
jQuery("#name").append("<?php echo woocommerce_page_title();?>");
});
/* ]]> */
</script>
I would use the
woocommerce_get_breadcrumb
filter to modify the contents of the array that is sent to the template. You can take the page name from the end and put it onto the beginning, or add any other breadcrumbs you want. Each element is an array with the first element being the text and the second element is the link.