• Resolved kellerpt

    (@kellerpt)


    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)
  • @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/

    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

    (@kellerpt)

    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

    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

    (@kellerpt)

    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

    https://lpress.fintrader.pro/

    @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/

    
    .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. Reason: added CSS example
    Thread Starter kellerpt

    (@kellerpt)

    @thomasplevy

    In settings in my template is set up correctly http://prntscr.com/h5by64, but the setting has no effect on the shortcode with the course.

    i add css code, now work fine.

    @kellerpt,

    In settings in my template is set up correctly 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

    (@kellerpt)

    Ok
    Thank you!

    Thread Starter kellerpt

    (@kellerpt)

    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.