Limit course title character on carousel

Home Forums Legacy Support Support queries How-to & Troubleshooting Limit course title character on carousel

Tagged: ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #153045
    hilmanf
    Spectator
    Hi, How to limit course title character on carousel? Like you see on image below, left course title takes 5 lines, when others are 2-3 lines. I need to limit the title to, for example, max 50 characters. "Apa Pekerjaan dan Usaha yang Cocok Buatmu? - Plus...", for example. Refer: http://prntscr.com/j4gdod   Thank you.
    #153085
    Diana
    Participant
    @hilmanf, Use this code to get the title of the carousel wp_trim_words( get_the_title($post->ID), 5 ); When we create a custom course carousel using this tip: https://wplms.io/support/knowledge-base/creating-custom-featured-block-style/ Here we fetch the post title using $post->post_title  Instead of this use above one
    #153092
    hilmanf
    Spectator
    I am not using page builder, but WP Bakery. Can I apply tip above on WP Bakery?
    #153156
    Anshuman Sahu
    Keymaster
    Please try adding this custom css in your wp-admin ->> appearance -> custoomize -> custom css : h4.block_title { max-height: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #24b7dc; }
    #153167
    hilmanf
    Spectator
    Hi Alex, Thanks for helping. But, It's only showing 1 title line. How to make it maximum 2 paragaph lines of title? I tried to modify 100px to 200 and 300 px, but it didnt work. Please refer: http://prntscr.com/j541ec Thank you.
    #153214
    Diana
    Participant
    This reply has been marked as private.
    #153246
    hilmanf
    Spectator
    Hi Diana, thanks for helping. Your code is awesome. But not applied to carousel block with different type. Please refer: https://prnt.sc/j5uixl Meanwhile, previous code from Alex applied to all block: Please refer: https://prnt.sc/j541ec Shortly, I need all carousel block (any type) to showing only 2 lines of paragraph. Need help to solve this. Thank you.
    #153388
    Diana
    Participant
    @hilmanf, Okay, If this is possible using custom css. I'll provide you the code. If not then also will let you know.
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Limit course title character on carousel’ is closed to new replies.