• Hello,

    I have an issue with the blog widget and I can’t figure out how to resolve it.
    Indeed, when one of the three entries is longer than the others, the following line won’t show completely.

    As you can see on the example provided (http://lesarts.epizy.com/test/), the first lines are okay, but the third one is messed up. Same with the 5th line.

    Even when I try to have smaller titles, the widget might chose to show more text lines resulting in the same issue.

    Is there any way to resolve this through CSS?

    Thanks a lot for your help and time.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @pampril,

    To get the result as you desired, you must activate the child theme. You can get knowledge about child theme and download the accelerate child theme from below link.

    https://themegrill.com/blog/tutorial-creating-wordpress-child-theme/

    Now that you’ve downloaded and activated the child theme, add the below code in functions.php.

    function flash_title_trim_words( $title )
    {
        if( !is_single() ) {
        // limit to five words
        return wp_trim_words( $title, 5, '...' );
        } else {
    	return $title;
        }
    }
    
    add_filter( 'the_title', 'flash_title_trim_words' );

    What it does is, it will limit the title words to 5 trailing with … but in inner page it will show full title.

    The process is tedious and I’ll advise you to attempt this only if you are confident enough and have a decent knowledge about coding.

    Thanks and Regards,
    Milan.

    Thread Starter pampril

    (@pampril)

    Hi @rubick322,

    Thanks a lot for your help! Nevertheless I’ve done everything you suggested and I still get the same problem.

    As you can see now, on line 1, the title of the 3rd post is made of several short words: consequently, the 5 words stand on 1 line only.
    I have other titles that naturally fit 1 line.

    I’ve tried to reduce titles to 4 words instead of 5, but they don’t really make sense anymore. Moreover, for line 1, column no.2, I still have 2 lines with 4 words.

    Isn’t there a way to ask the following line to show, even when the columns are not aligned?

    Hi @pampril,

    Please add the following CSS:

    .blog-wrapper.tg-column-wrapper {
        display: flex;
        margin-left: -1rem;
        flex-flow: row wrap;
    }

    Help link https://docs.themegrill.com/knowledgebase/where-do-i-add-my-custom-css/

    This should do the trick and if you want, you can revert the previous changes you made. I believe after adding above CSS there won’t be such problem regardless the title length.

    Thanks and Regards,
    Milan

    Thread Starter pampril

    (@pampril)

    Working perfectly!!

    Thanks a lot for your help!

    Hi @pampril,

    Great to hear it worked for you, if you liked our theme and enjoying the support we would be thrilled if you drop a review. Your review would be an enormous help. And if you ever have a query please let us know.

    Thanks and Regards,
    Milan.

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

The topic ‘Blog Widget’ is closed to new replies.