1) I'm trying to remove the breacrumb from page-title div using php instead of display:none but i can't manage to found the good hook, i check in many different php files etc but anyway i'm not good enough in PHP. I'm like zero.
2) I also want to display the breadcrumb into the footer. I manage to found a way to add it into the footer already using simply
add_action( 'flatsome_footer', 'flatsome_breadcrumb', 10 );
But i did not found the hook to put it into their "footer-1" that is a child div of the footer block. This flatsome_footer is the parent div and it will make me add more css for it.
Here is the documentation of the flatsome theme (Actions & Filters), it may can help (i try many different as i say & open php files but cant manage to remove it by remove_action maybe i have to add filters idk... i'm just bad.
https://docs.uxthemes.com/article/385-hooks#flatsome_footer
All i know is that their page title block is using (shop-page-title category-page-title page-title) css class.
Thank you very much for helping.
If you want remove breadcrumb from shop or product page, you should findout hook from below files and comment that code.
Category Page File: yourthemepath/woocommerce/layouts/headers/category-title.php
Please check https://docs.uxthemes.com/article/385-hooks#flatsome_category_title
Product Page: https://docs.uxthemes.com/article/385-hooks#flatsome_product_title
Related
I am creating a plugin for Wordpress. I'm in doubt which hook I need to call to add custom content to the Wordpress side menu bar.
I want to add a widget with a chart over there.
I already researched, but I didn't find anything about it. It would be better if I didn't need to change the files in the sidebar but rather do everything for my plugin.
You're looking for two functions add_menu_page and add_submenu_page
Detailed instructions are here:
https://developer.wordpress.org/reference/functions/add_menu_page/
https://developer.wordpress.org/reference/functions/add_submenu_page/
I'm looking for a way to customize the woocommerce sidebar. I was able to find the template named sidebar.php but it only contain the get_sidebar('shop') function, but there is no sidebar-shop.php file inside the woocommerce templates folder. I'm not able to customize it to place it on the right side of the screen. I've setted up bootstrap rows and classes for almost all of the main templates files, but also if I set three products per row and col-3, the sidebar will stay to the bottom of the page. I'm using hooks as suggested from docs. Can anyone guide me please?
I've read through around 30 or 40 different articles today on how to achieve this and none give a really good simple answer.
Long story short, we have circa 40 categories and simply want to add a block of text with a link within it at the foot of every category page.
So looking to edit the category page template. We have our woocommerce folder setup in child theme and have other files overriding the default plugin. So we understand that it is probably the content-product.php file that is to be edited? But where and what code is applied? Tried adding in near the bottom but it gets caught up in the loop and adds it to the page for the number of products in that category as looped with product title, image etc.
Should we look at adding custom php in our child theme's functions.php file?
Any help greatly appreciated. Thanks.
There are a few different ways you can approach this but for the most part you're going to need to write some PHP.
To place something at the bottom of a category page you need to check how WooCommerce displays categories. Visiting the taxonomy-product_cat.php WC template will reveal that categories use archive-product.php. The next step would be to review that template file.
You want something to be shown at the bottom of the category page, it's only going to be displayed once so it doesn't belong inside the main products loop.
If you override the archive-product.php template and manually insert a link, it's going to appear not just on the categories but also the shop and tag pages. That tells you that you need a conditional to limit the display of the link.
Using the hooks WooCommerce provides means you won't have to override the template at all. There are 2 hooks in the file which may be suitable:
woocommerce_after_shop_loop - executed after the loop when there are products
woocommerce_after_main_content - executed at the bottom of the page whether or not there are products.
Write a function to output your link using one of those hooks:
function wpse_wc_category_footer_link() {
// woocommerce_after_main_content is a generic hook; check we're on a category page.
if ( ! is_product_category() ) {
return;
} ?>
<!-- Your markup for category pages belongs here... -->
My Link
<?php
}
add_action( 'woocommerce_after_main_content', 'wpse_wc_category_footer_link', 5 );
I am new to using woocommerce and only been working with wordpress about six months so may be an easy answer.
I don't want any columns in my archive at all. I just want to display the products using a responsive grid system like this ...
http://www.responsivegridsystem.com/
or use masonry (preferred).
I have used masonry in a page template in wordpress to display an unordered list before without a problem but cannot figure out how to use it or the responsive grid with woocommerce shop.
How can I stop woocommerce using columns ?
Thanks
Overriding can be done in various ways, here's the cleanest approach:
The file is located at wp-content/plugins/woocommerce/templates/archive-product.php. You should put it in your theme folder - wp-content/themes/woocommerce/archive-product.php. Then make the changes you want. For instance, I'd start with removing the line do_action( 'woocommerce_sidebar' ). You might also want to override wrapper-start.php and wrapper-end.php found in the templates folder ( in either shop or global subfolder, depending on woocommerce version ), which can be overriden exactly the same way.
For reference, see their documentation: http://docs.woothemes.com/document/template-structure/
MSTAnnu put me on the right lines, I needed to be using content-product.php, and added a class to the tag in there. This overrides all column issues.
I changed the tag in the loop-start.php file in templates/global and used css to style into a responsive design using %. Not used to masonry layout yet but if I do will add solution here unless someone beats me to it.
I'm trying to add additional content (such as a banner image, an additional loop) to the WooCommerce plugin, but I'm having trouble trying to output such said content.
I'm trying to make WooCommerce output <div>s with <img> tags in the wrapper-end.php template area after the <div>s, but nothing comes up.
I've also tried placing the extra content after <?php woocommerce_content(); ?> in woocommerce.php, but it duplicates itself for every single page afterwards.
I'm confused. Is it possible? Am I doing something wrong?
I'm trying to do something like this.
Can someone share their experience?
if you don't use the catch-all woocommerce_content() function, but the hooks instead, you can customize every page individually by just copying all the files from woocommerce/template to yourtheme/woocommerce. See woocommerce docs for more info.
The templates will also show you the other hooks & filters that you can use to place your content.