Show Woocommerce breadcrumbs on Category page - woocommerce

I am using the most current version of Woocommerce. I have breadcrumbs showing on a product page, but I want these displayed on a Category page also. Is there a hook for this? or do I need to edit a template file?

Add following code somewhere in your theme php files:
<?php woocommerce_breadcrumb(); ?>

Related

Wordpress Custom Woocommerce category page

I have pages for every category in woocommerce. These are listed as follows:
http://example.com/parent-category/category-a
http://example.com/parent-category/category-b
http://example.com/parent-category/category-c
I want to customise the last link to be a custom-built page but still retain the link and not just doing redirects.
I currently use WooCommerce Permalink Settings plugin
Create file "some-single.php" and after this create "some-yourCategoryName". Now open single.php and and replace this get_template_part('content','single'); by following code
with this:
if(is_category('yourCategoryName')){
get_template_part('content','yourCategoryName');
}else{
get_template_part('content','single.php');
}
Will be fine.

Which template file woocommerce is calling for product shortcode?

I am using this shortcode [products limit="4"] to show the products on a different page called Theme.
Now I want to change the layout style of this Theme page by overriding woocommerce template file.
1) Which template file woocommerce is calling for this shortcode?
2) Can you give me a full reference where I can find which template file is responsive for which shortcode?
Regards.
Every shortcode related to product listing is calling template named content-product.php via follows -
// Render product template.
wc_get_template_part( 'content', 'product' );
You can find it here

Custom page template displays the archive template

I have a custom page template named "page-news.php" and it contains
<?php
/*
* Template Name: News
*/
get_header();
?>
test
<?php
wp_footer();
get_footer();
?>
and I then create a page and set the template to "News" but when I view the page, it does not display the contents on the page-news.php custom page template, instead it display the archive.php contents (I have test it, whatever I put unto the archive.php contents, it display on the page that I hook unto the page-news.php custom page template). Any ideas, help please? I'm running WP 4.7.2.
Please rename the file name i.e. from 'page-news.php' to 'news.php' or any other name but don't add 'page-' in the file name & then select the template again for the page in the admin backend.
Hope, this will help you.

Can Shortcodes be used in a Static WordPress Homepage?

I have a Static page set as the home page of my wordpress website. It has a custom shortcode to show a woocommerce catalog based on my own meta query.
When I add valid products, it does not show up immediately or even after a while. However, if I publish the static page, then it shows up magically, thus leading to my question.
What are my alternatives, if I want to show my shortcode on a static home page?
I think this is my problem and nothing else, because I tried disabling all plugins and clearing the cache, but still it did not show the latest added products.
You can edit the template of your theme adding the do_shortcode() function where you want the shortcode to be displayed, for example:
<?php echo do_shortcode( '[contact-form-7 id="91" title="quote"]' ); ?>

woo commerce - how to show custom fields on published page

I have set 2 custom fields on the wordpress / woocommerce product page called "imballo" and "sottoimballo" with their values. How do I display these on the published page?
Thanks!
You would have to display the custom fields in the WooCommerce Single Product Page template,
You could do it in two ways,
Add a code in an existing hook of the Product Single page. Check hooks here
Modify the template by overriding it in your WordPress theme. Read here
And in the place where you want to display do the following,
<?php
//Please add your HTML structure as needed.
echo get_post_meta(get_the_ID(), 'imballo');
echo get_post_meta(get_the_ID(), 'sottoimballo');
?>

Resources