Service widget more than two lines


Is it possible to have more than two lines on this widget ? I need three or four lines.



Did you try to add more services? They should appear automatically if you have set -1 value for Number of services to show option in widget settings.

Kind Regards, Roman.

Oops, I misunderstood. I can’t put text on more than 2 lines in each service, it is truncated.


You can edit inc/framework/widgets/front-services.php file using a text editor and replace this line:
<?php echo wp_trim_words( get_the_content(), 12 ); ?>

…with this:
<?php echo get_the_content(); ?>

You should override modified .php file using a child theme to avoid losing your changes after theme update.

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.

Thanks a lot, I look at this this week. I need to see how I can override the php file using a child theme.

Regards Guik

You are welcome Guik,

For that particular file you should create three folders recursively in child theme folder:
inc/framework/widgets/, then put modified widget file there.

You can learn more about child themes on this WordPress Codex page:

Kind Regards, Roman.

I thanks for all, I will test this

Okay, you are welcome Guik!

Kind Regards, Roman.

Perfect tipp Roman, thank you! I was just wondering:what if I don’t want to show the text at all? Normally I would use CSS to not display the class, but in this case the class includes the headline of the service (which I want to display).

So can i simply do this?
<?php echo wp_trim_words( get_the_content(), 0); ?>

Thank you!

Hello, in your case you can just remove that row I think.

Kind Regards, Roman.

Ok, but since I don’t want to touch the themes code, I have to handle it in my child theme. There I can’t tell the main theme to ignore a line, can I? So I’d have to overrule it?

Thanks, Alex

Yes Alex, you’ll have to modify the .php file and override it in a child theme like I described above.

Kind Regards, Roman.

@roman I test your solution, it’s ok for me. Thanks a lot

Great! You are welcome Guik :slight_smile:

Kind Regards, Roman.