Woo Commerce, remove columns completely in archive - php

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.

Related

PHP Woocommerce Flatsome theme - Remove breadcrumb from shop page title

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

Customising WooCommerce "products" listing HTML layouts

I'm currently adapting the WooCommerce Storefront theme for a client and am struggling to change the layout for the woocommerce "products" widget that displays a list of given products. I believe the template for this is "plugins/woocommerce/templates/content-widget-product.php".
However, adding it to my theme's "themes/mytheme/woocommerce/content-widget-product.php" directory and adjusting it doesn't appear to work.
Essentially I need to change the default structure from this:
To This:
I must be missing something obvious, surely?
OK, so within WooCommerce there is "content-widget-product.php" which returns a product's details for one type of widget.
There is also "content-product.php" which returns a product for their main [Products] shortcode loop... the main loop that gets used on the shop page, etc.
Editing the content-product.php file and overriding its related WooCommerce functions achieved what I needed.
Hopefully, this might help someone else in the future and save a few hours of hunting around!

How to get submenu dropdown with images in wordpress?

I'm a very beginner in wordpress.
I need to add submenus with images in wordpress. Let's assume Main menu has menu1, menu2, menu3, ...etc. and I need to add submenu1, submenu2, submenu3, ...etc under the menu2 as sub dropdown menus with featured images. Can anyone tell how to do that in wordpress?
Can I use two menu plugins simultaneously?
You should look for a mega-menu plugin or maybe use a custom theme that already includes one.
this one is free and wellknown: https://de.wordpress.org/plugins/megamenu/ (wellnown is important because of the docu and the community if you need help). This will be the easiest thing if you're new to wordpress.
Correction after talkin to lee. He / she is right. The following part is the 'advanced" solution.
I, after 10 years of WP development, would code my own function, hooking into the wordpress image uploader. Many scripts are allready included in wordpress / many functions are working out of the box. Image upload is one of those scripts / functions.
So you can enqueue the script that wordpress delivers (see following link, 'Default Scripts Included and Registered by WordPress' > 'Media Upload'):
https://developer.wordpress.org/reference/functions/wp_enqueue_script/
As a real example how to implement it, would be way too much in this answer, I am giving you this link: http://code.tutsplus.com/tutorials/getting-started-with-the-wordpress-media-uploader--cms-22011 (usually i wouldn't paste a link as a answer, but as this is a side-answer / tip i guess it's okay).
All the best

How to add a widget by its shortcode on Wordpress posts / pages?

Is there any way we can assign a shortcode to already created widget and later use that
shortcode in our specific posts and pages to show that widget instead of trivial method of
showing widgets in sidebar ? I googled about this stuff didn't find anything relative.
Any suggestion would be welcome!
Yes, You can call widget in Post/Page using shortcode. Follow this link to establish a system like that.
http://digwp.com/2010/04/call-widget-with-shortcode/
This might be relevant.
Widgets on Pages
https://wordpress.org/plugins/widgets-on-pages/
Observations and two questions:
This plugin allows insertion of 1 or "sets" of widgets via shortcode into pages, posts, (and Custom post types?) and it will also save a list of configured shortcodes~sets. VERY handy!
When comparing its features to the plugin Widgets Shortcode, that plugin does not provide a means to save "sets" of plugins, rather it seems to focus on inserting widgets individually. In fact, it inserts the shortcode for each widget in the bottom edge of each widget and it assigns different shortcodes to each instance of a widget. Also nice.
https://wordpress.org/plugins/widget-shortcode/
I like the granularity Widgets Shortcode provides with an individual shortcode for every instance of every widget. When running it and your plugin simultaneously even widgets saved in your plugin's "sets" are still assigned individual shortcodes. Those individual shortcodes allow using a specific widget out of a "set" in a different location without needing to create an additional instance of the widget as it appears would be required with your plugin.
Incidently, for anyone who wants both of these features, these two plugins play very nicely together on one of our WP 4.0 Multisite installations with 50+ sites and even on a site using the theme Make.
FYI: We also tested amr shortcode any widget, but had some issues with it and rather than troubleshoot it we moved on. To be fair, we were testing quickly on a site with over 160 plugins active. Yes, 160 plugins. I know, I know, but think about it for a minute. Any plugin that you can activate into that mix of 160 plugins and it does not break things or introduce issues, then it suggests a good probability of it being troublefree to use.... well at least until the next round of WP updates. :)
We also tested Widgetize Pages Light and its pro version Sidebar & Widget Manager and had no issues with either. However, if only seeking to insert widgets into pages and posts these plugins seem like overkill as they provide additional page layout functions that may duplicate theme functions and/or other plugin functions.
I was looking for a "widgets in pages" plugin that provides a TinyMCE button to insert the widget shortcodes.
Can anyone recommend one that has a TinyMCE button to insert the widget shortcodes in pages, posts and CPTs?
Ultimately I selected Widgets On Pages as having the best combination of features for this application. Its simple to understand, easy to use, versatile and has worked flawlessly for us, even along side Widgets Shortcode.
You can do it by wordpress WordPress Widgets Shortcode plugin, you can Embed any widget area/dynamic sidebar to your pages/posts using this plugin as a shortcode
edit widgets in wp :
file in # wp-includes/widgets.php: register_widget()
in source view sample :
public function register( $widget_class ) {
$this->widgets[$widget_class] = new $widget_class();
}

Add additional content to WooCommerce layout?

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.

Categories