Last active
November 4, 2016 19:57
-
-
Save thomasplevy/682f619c6a396e14639dbe11814a5b00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this line to your functions.php file | |
/** | |
* Customize the number of columns displayed on LifterLMS Course and Membership Catalogs | |
* Note that LifterLMS has native support for 1 - 6 columns | |
* If you require 7 or more columns you will need to write custom CSS to accommodate | |
* @param int $cols default number of columns (3) | |
* @return int | |
*/ | |
function my_llms_loop_cols( $cols ) { | |
return 2; // change this to be the number of columns you want | |
} | |
add_filter( 'lifterlms_loop_columns', 'my_llms_loop_cols' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this line to your functions.php file | |
/** | |
* Customize the number of columns displayed on LifterLMS Course and Membership Catalogs | |
* Note that LifterLMS has native support for 1 - 6 columns | |
* If you require 7 or more columns you will need to write custom CSS to accommodate | |
* | |
* This version displays a different number of columns on Course & Membership Catalogs | |
* | |
* @param int $cols default number of columns (3) | |
* @return int | |
*/ | |
function my_llms_loop_cols( $cols ) { | |
if ( is_post_type_archive( 'course' ) ) { | |
return 4; | |
} elseif ( is_post_type_archive( 'llms_membership' ) ) { | |
return 2; | |
} | |
return $cols; | |
} | |
add_filter( 'lifterlms_loop_columns', 'my_llms_loop_cols' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment