Hi there, I’m trying to display the entire post title on the single post view. It is currently clipped with an ellipsis. Is there a way to change this with CSS? Thanks!
I hope you are well today and thank you for your question.
I’m sorry you can’t do this with CSS, you’ll have to edit the theme code.
- Create a child theme
- Copy the following file flies located in shapely > template parts > layouts to the child theme.
- In each file here are the lines where the code is located that you’ll need to edit.
content-grid-small.php line 52
content-grid-wide.php line 59
content-search.php line 48
content-php line 63
In these files on those lines you’ll find the following
echo wp_trim_words( get_the_title(), 9 );
You can change the number 9 to a higher value such as 20 to increase the number of words shown in the title.
Thanks so much. I made a child theme, activated it and I believe it’s working… But when I copied the files to the child theme and edited them and uploaded them, the post-title length did not change. Can you please take a look at my child theme files? Thank you!
I tried adding
require_once( get_stylesheet_directory() . ‘/content-grid-small.php’ );
require_once( get_stylesheet_directory() . ‘/content-grid-wide.php’ );
require_once( get_stylesheet_directory() . ‘/content-search.php’ );
to the child theme functions file which resulted in an error (please see attached)
Any idea how to get the child theme to load the changes in the php files? Thank you!
Can you try this Child theme, http://take.ms/7VKvx
Let us know,
I uploaded the child theme you provided. The post-title is still clipped, and the layout is no longer centered in the page. Any thoughts? Thanks!
Here is a page for reference: