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