This topic has 4 replies, 2 voices, and was last updated 10 years by sharmstr.

  • Author
  • #33322
     sowmya
    Participant

    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!
    Sowmya

    #33410
     sowmya
    Participant

    Hi,

    Any idea on how this can be achieved?

    Thanks!
    Sowmya

    #33430
     sharmstr
    Moderator

    Hello,

    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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33441
     sowmya
    Participant

    Hi,

    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!
    Sowmya

    #33442
     sharmstr
    Moderator

    I 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

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

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?