Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created October 21, 2017 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasplevy/9d2a98b5f4a7f0d531dbcea978f606be to your computer and use it in GitHub Desktop.
Save thomasplevy/9d2a98b5f4a7f0d531dbcea978f606be to your computer and use it in GitHub Desktop.
<?php // don't copy this line to your functions.php file
/**
* Modify the number of columns used when looping achievements on the student dashboard
* We have CSS in the core for anywhere from 1-5 columns
* if you need more than 5 columns you'll want to add additional custom css to acommodate:
* .lifterlms ul.llms-achievements-loop.loop-cols-6 li.llms-achievement-loop-item { width: 16.666%; }
* @param int $cols number of columns (default is 4)
* @return int
*/
function my_achievement_loop_columns( $cols ) {
return 5;
}
add_filter( 'llms_achievement_loop_columns', 'my_achievement_loop_columns', 999, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment