-
Author
-
October 28, 2014 at 16:18 #33322sowmyaParticipant
Hi,
We would like to use the posts grid for displaying the post excerpts in home page. We came across an issue that since the excerpt shown for each post is based on number of words currently, few post excerpts will have more length than the other one. This creates slight difference in the length of columns for each post and little less uniform. It looks a bit odd in home page.
Is there any way where we can show the post excerpts in home page based on number of characters so that all the post excerpts will have equal number of characters and will have uniform looks.
Currently in post grid build query I can just decide the number of posts and the order. Could not find any way to decide the excerpt length.
Thanks in advance!
SowmyaOctober 29, 2014 at 10:15 #33410sowmyaParticipantHi,
Any idea on how this can be achieved?
Thanks!
SowmyaOctober 29, 2014 at 15:31 #33430sharmstrModeratorHello,
The post grid is a visual composer shortcode that comes standard with VC. If you look through their code, you’ll see that they call a function called getPostExcerpt(). Within that function, they are calling the standard get_the_excerpt wordpress function which is based on word count. http://codex.wordpress.org/Function_Reference/get_the_excerpt
Near the bottom of that page you’ll see “Use get_the_excerpt() to print an excerpt by specifying a maximum number of characters.”
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 29, 2014 at 16:36 #33441sowmyaParticipantHi,
Thanks for your reply. But is it possible for us to change the excerpt length based on character length? Can we do it without touching theme files?
If we need to touch the theme files, is it a minor change or does it need huge amount of code change?
Thanks for your support!
SowmyaOctober 29, 2014 at 16:45 #33442sharmstrModeratorI thought explained that. Kleo is not responsible for the grid post shortcode or the excerpt. The shortcode is created and displayed by visual composer. The excerpt is handled by wordpress. If you go to the bottom of the link I sent you, it shows you how to get the excerpt based on number of characters instead of number of words.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.