WordPress.org

Forums

Projects by WooThemes
[resolved] Change number of columns using filter not working (4 posts)

  1. digitalisfun
    Member
    Posted 11 months ago #

    Hey

    I just tried to change the number of columns using the suggested code found here (http://docs.woothemes.com/document/change-the-number-of-project-columns-on-archives/) in functions.php of my child theme but it doesn't work.

    add_filter( 'projects_loop_columns', 'jk_projects_columns' );
    function jk_projects_columns( $cols ) {
    	$cols = 3;
    	return $cols;
    }

    I tried copying archive-project and setting the value which works but would prefer to just use the filter. Any idea why the code might not be working?

    Thanks,

    Greg

    https://wordpress.org/plugins/projects-by-woothemes/

  2. jameskoster
    Member
    Plugin Author

    Posted 11 months ago #

    Just tested this and can confirm it works. What them are you using? Can I see a URL?

  3. digitalisfun
    Member
    Posted 11 months ago #

    Thanks for checking it out James. I am using the latest version of Canvas with a child theme. The URL is private as the site is under development. I just tried removing all code from my functions.php except the above snippet with no luck. Bit stumped :)

  4. digitalisfun
    Member
    Posted 11 months ago #

    Had another look at this and this code worked for me:

    add_filter( 'projects_loop_columns', 'gw_woo_custom_projects_loop_columns', 99 );
    function gw_woo_custom_projects_loop_columns( $columns ) {
        $columns = 3;
        return $columns;
    }

Reply

You must log in to post.

About this Plugin

About this Topic