Excerpt length in characters

  • Anonymous

    #8421

    I’m using the code below to limit the word length in the homepage panes and category post content excerpt.

    My question is how would I code this as “characters” and then end in a full word?

    Also, how would I display the manual excerpt field in the post edit page first and then pull the post content excerpt if that field was empty?

    I’ve searched the forum but it only results with solutions for word length, not characters.

    function graphene_custom_homepage_panes_excerpt_length()
    {
    graphene_set_excerpt_length(11);
    }
    add_action( 'graphene_before_homepage_panes', 'graphene_custom_homepage_panes_excerpt_length');

    function graphene_custom_post_content_excerpt_length()
    {
    graphene_set_excerpt_length(30);
    }
    add_action( 'graphene_before_post_content', 'graphene_custom_post_content_excerpt_length');
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!