Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter AmandaEve

    (@amandaeve)

    i found this in custom-functions.php

    add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 10 );

    Plugin Contributor Mike Jolley

    (@mikejolley)

    What does thim_woocommerce_columns_product function look like?

    Thread Starter AmandaEve

    (@amandaeve)

    i added this …

    add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 1, 10 );
    
    /*
    * Return a new number of maximum columns for shop archives
    * @param int Original value
    * @return int New number of columns
    */
    function wc_loop_shop_columns( $number_columns ) {
    return 2;
    }

    but it didn’t do anything

    Plugin Contributor Mike Jolley

    (@mikejolley)

    If whatever thim_woocommerce_columns_product is is also changing columns, yours won’t affect things.

    Thread Starter AmandaEve

    (@amandaeve)

    i just tried:

    // Change number or products per row to 3
    add_filter('loop_shop_columns', 'loop_columns');
    if (!function_exists('loop_columns')) {
    	function loop_columns() {
    		return 3; // 3 products per row
    	}
    }

    nothing

    Thread Starter AmandaEve

    (@amandaeve)

    Oh – sorry Mike … didn’t see your comments.

    Thread Starter AmandaEve

    (@amandaeve)

    i’m going to look for the thim_woocommerce_columns_product function now … i think i’ll find it in the theme files … i think. :s

    Plugin Contributor Mike Jolley

    (@mikejolley)

    If you want yours to take priority if you cannot find it, change to this:

    add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 20 );

    Thread Starter AmandaEve

    (@amandaeve)

    i found this …

    /**
     * Filter columns product in archive product
     */
    if ( ! function_exists( 'thim_woocommerce_columns_product' ) ) {
    	function thim_woocommerce_columns_product( $current ) {
    		if ( is_archive() ) {
    			$theme_options_data = thim_options_data();
    			if ( isset( $theme_options_data['thim_woo_cate_columns'] ) ) {
    				return intval( $theme_options_data['thim_woo_cate_columns'] );
    			} else {
    				return 3;
    			}
    
    		}
    
    		return $current;
    	}
    }
    
    //add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 10 );
    add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 1, 10 );
    
    /*
    * Return a new number of maximum columns for shop archives
    * @param int Original value
    * @return int New number of columns
    */
    function wc_loop_shop_columns( $number_columns ) {
    return 2;
    }

    Thread Starter AmandaEve

    (@amandaeve)

    maybe it’s set up somewhere to put six in a row …. that would explain the wonky-ness … right?

    Thread Starter AmandaEve

    (@amandaeve)

    Plugin Contributor Mike Jolley

    (@mikejolley)

    See my prev comment

    Thread Starter AmandaEve

    (@amandaeve)

    Sorry – it doesn’t change anything. I put it in functions.php in the child theme. not the custom-functions.php. Should I have?

    Thread Starter AmandaEve

    (@amandaeve)

    I replaced:
    add_filter( 'loop_shop_columns', 'thim_woocommerce_columns_product', 10
    with
    add_filter( 'loop_shop_columns', 'wc_loop_shop_columns', 20 );

    this no change.

    link to page: newsstand

    Plugin Contributor Mike Jolley

    (@mikejolley)

    It has classes for 2 column, but I don’t think the CSS has a rule to clear on .first.

Viewing 15 replies - 1 through 15 (of 21 total)

The topic ‘Product Grid Wonkiness’ is closed to new replies.