Title: Courses shortcode
Last modified: October 30, 2017

---

# Courses shortcode

 *  Resolved [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * (@kellerpt)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/)
 * Hello!
 * How to make shortcode to display 4 columns instead of three with the course?
 * [lifterlms_courses posts_per_page=”8″]

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/)
 * (@thomasplevy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9635298)
 * [@kellerpt](https://wordpress.org/support/users/kellerpt/),
 * The courses shortcode obeys the catalog settings for the number of columns sitewide.
   EG: if you show 3 columns on your catalog you show 3 columns when using the shortcode.
 * You can change the number of columns displayed for all loops using this filter:
   [https://lifterlms.com/docs/can-change-number-columns-displayed-course-membership-catalog/](https://lifterlms.com/docs/can-change-number-columns-displayed-course-membership-catalog/)
 * You’ll see this second example customizes the number of columns for courses and
   memberships as different numbers. If you get smart you can customize the number
   of columns using a shortcode by adding a condition using a page id where the 
   shortcode has been added:
 *     ```
       function my_llms_loop_cols( $cols ) {
         if ( is_page( 123 ) ) {
            return 4;
         }
         return $cols;
       }
       add_filter( 'lifterlms_loop_columns', 'my_llms_loop_cols' );
       ```
   
 * In that example the page ID of the page where your shortcode is is “123”
 * Hope that helps.
 *  Thread Starter [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * (@kellerpt)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9635669)
 * Hello
 * This snippet not work ((
    work only
 *     ```
       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' );
       ```
   
 * And another question, how to make the minimum width for mobile devices was 900px
 *  [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/)
 * (@thomasplevy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9638970)
 * Where are you adding your filter? Try adding a higher priority:
 * `add_filter( 'lifterlms_loop_columns', 'my_llms_loop_cols', 99999 );`
 * > And another question, how to make the minimum width for mobile devices was 
   > 900px
 * This is highly dependent on your theme and I will not be able to guess at some
   custom CSS to make this possible. You should reach out to your theme developers
   for the best way to do this on your theme.
 * If you provide a link I’ll see if I can help but I can’t promise I’ll be the 
   best at helping with that kind of thing.
 * Best,
 *  Thread Starter [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * (@kellerpt)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9639698)
 * Hello, Thomas
 * > This is highly dependent on your theme and I will not be able to guess at some
   > custom CSS to make this possible. You should reach out to your theme developers
   > for the best way to do this on your theme.
   > If you provide a link I’ll see if I can help but I can’t promise I’ll be the
   > best at helping with that kind of thing.
 * In my theme is setup to 900px, but to shortcode is not working.
 * [http://prntscr.com/h4pank](http://prntscr.com/h4pank)
 * [https://lpress.fintrader.pro/](https://lpress.fintrader.pro/)
 *  [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/)
 * (@thomasplevy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9642655)
 * [@kellerpt](https://wordpress.org/support/users/kellerpt/),
 * I misunderstood the question.
 * CSS isn’t filterable like PHP is but you can very easily copy the CSS you’ve 
   highlighted and change the default “600px” to your preferred “900px”
 * Add that to your site via the customizer: [https://lifterlms.com/docs/add-custom-css-using-wordpress-customizer/](https://lifterlms.com/docs/add-custom-css-using-wordpress-customizer/)
 *     ```
       .llms-loop-list.cols-4 .llms-loop-item {
        width: 100%;
       } 
       @media (min-width: 900px) {
          .llms-loop-list.cols-4 .llms-loop-item {
            width: 25%;
          } 
       }
       ```
   
 * Hope that helps,
    -  This reply was modified 8 years, 7 months ago by [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/).
      Reason: added CSS example
 *  Thread Starter [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * (@kellerpt)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9644736)
 * [@thomasplevy](https://wordpress.org/support/users/thomasplevy/)
 * In settings in my template is set up correctly [http://prntscr.com/h5by64](http://prntscr.com/h5by64),
   but the setting has no effect on the shortcode with the course.
 * i add css code, now work fine.
 *  [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/)
 * (@thomasplevy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9646042)
 * [@kellerpt](https://wordpress.org/support/users/kellerpt/),
 * > In settings in my template is set up correctly [http://prntscr.com/h5by64](http://prntscr.com/h5by64),
   > but the setting has no effect on the shortcode with the course.
 * Right, I know! I misunderstood the original request. Use that custom CSS and 
   ignore my previous statement. It came from a place of misunderstanding!
 *  Thread Starter [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * (@kellerpt)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9646617)
 * Ok
    Thank you!
 *  Thread Starter [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * (@kellerpt)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9652264)
 * How to make to display only 8. Not on every page, only 8 courses on page.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Courses shortcode’ is closed to new replies.

 * ![](https://ps.w.org/lifterlms/assets/icon.svg?rev=2034507)
 * [LifterLMS - WP LMS for eLearning, Online Courses, & Quizzes](https://wordpress.org/plugins/lifterlms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lifterlms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lifterlms/)
 * [Active Topics](https://wordpress.org/support/plugin/lifterlms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lifterlms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lifterlms/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [kellerpt](https://wordpress.org/support/users/kellerpt/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/courses-shortcode/#post-9652264)
 * Status: resolved