i have a WordPress site using Avada theme, and Woocommerce. The products categories pages will show 16 items at a time. My issue is that the sidebar's existence means the products are 3 in a row, and this causes the last row to only have 1 product. This can lead the user to think there aren't anymore pages.
I need to show 12 items instead of 16, and that will fix me! I am comfortable editing theme files / CSS. I was hoping for insight to the best way. Thanks!
https://paramedsupply.com/product-category/blood-collection/
it was in Avada > Woocommerce settings! I just found it. I had assumed it wouldn't be that easy!
For anyone else having this problem with other themes and can't seem to override any display settings.
You could declare the following WooCommerce theme support arguments:
function mytheme_add_woocommerce_support() {
add_theme_support( 'woocommerce', array(
'thumbnail_image_width' => 150,
'single_image_width' => 300,
'product_grid' => array(
'default_rows' => 3,
'min_rows' => 2,
'max_rows' => 8,
'default_columns' => 4,
'min_columns' => 2,
'max_columns' => 5,
),
) );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Related
I'm using woocommerce hooks with thumbnail regenerate plugin but still have same issue i didn't see any changes in my website i removed cache as well.
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'override_woocommerce_image_size_gallery_thumbnail');
function override_woocommerce_image_size_gallery_thumbnail( $size ) {
// Gallery thumbnails: proportional, max width 200px
return array(
'width' => 100,
'height' => 100,
'crop' => 0,
);
}
I think the answer to that is in the "Appearance / Customize" then Woocommerce. There you can choose how products images are cropped.
With you alls help I was able to the desire thumbnail on the main page and product category pages. I followed Appearance > Customize > WooCommerce > Product Image.
However, on the individual product page, those actions don't apply. I am still getting cropped images. Any help with suggestions/advice would be appreciated.[enter
Try to add this in your child theme’s functions.php
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) {
return array(
'width' => 150,
'height' => 150,
'crop' => 0,
);
});
I am working on an e-commerce deal site using woocommerce, and I would like to set up my deals in advanced. To start, I am displaying 1 product a day in a static homepage using the woocommerce shortcode:
[product_page id="1"]
How can I get the id to increment once a day, so that a new product is displayed every day? Are there any good extensions that allow me to force a WordPress page to edit itself every day?
Thanks!
You can write a shortcode to show one recent product. So that the recently added one product will be show on the page.
Use new WP_Query( $args ) with
$args = array(
'post_type' => 'product',
'posts_per_page' => 1,
);
Please refer the link for more details. You can also refer codex
You can also use this way without shortcode.
echo WC_Shortcodes::product_page( array( 'id' => 1) );
I have tired of googling that how I can list all media Categories in WordPress.
Any Idea? Also after getting the media category list, i would like to display the media associated with each category.
Thanks
Shubhajeet Saha
$args = array(
'orderby' => 'id',
'hide_empty'=> 0,
'child_of' => 10, //Child From Boxes Category
);
$categories = get_categories($args);
print_r($categories);
Actually this plugin is simply added category option from default post to media. so you can get category easily with multiple method. goto this link
How to display my all category names using loop (WordPress)
I see in most WP templates that the homepage is very beautiful, designed with banners etc. Is it possible to do the same for each category page (after all these pages are landing pages)?
I want it to show both promotional stuff on top (banners etc.) and latest category posts on bottom. The default is only latest posts.
Thanks
Firstly your question is not clear and you just asked a general question for that answer is Yes absolutely Possible. Without any specific information of theme or error, we cant help you.
Here is some thought:
You can easily customize wordpress theme category page category.php or even if you want a different category template for only one category, you can do that. To do that, create category-[slug].php or category-[id].php file in your theme files - replace slug or id whatever you use with that of category you want a different tempelate.
Once you edit template for category page, you can add all options yourself - Good option is to display a Slider of category page and query posts for that category only to show on that slider or show promotional stuff on top from that category in slider or show banners whatever you want.
For example, you can alter your query to display latest posts from that category only to show in slider etc like using following query:
$current_category = single_cat_title("", false);
$args = array(
'numberposts' => 5,
'offset' => 0,
'category_name' => $current_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish' );
$recent_posts = get_posts( $args );
If it's using WP_Query, your query should look something like this:
$current_category = single_cat_title("", false);
$cat_posts = new WP_Query('showposts=5&category_name='.$current_category);
while ($cat_posts->have_posts())
...
And of course you can put a flag for promoted offer posts in your database as well and then add parameter of 'promoted' => 'true' in above example queries to show only promoted posts in that slider etc.
p.s I just gave general thought - you need some knowledge of php, wordpress API for this and this is easily possible.
Vote up for me and accept the answer if i helped you.
There are many themes available in market with such options as well that you can use.