Word Limit for Post Excerpt in Home Page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8481 Reply

    Joseph Nirmal

    Currently I activate full text for Post Excerpt in Home Page. But I want full text only for Sticky Post and 100 words for all Post Excerpt.

    #8486

    Ron
    Keymaster

    – Use a child-theme https://ronangelo.com/frontier/

    – Copy loop-blog.php from the parent-theme to your child-theme folder

    – Open your child-theme loop-blog.php and find this line:

    <?php if ( frontier_option('blog_display', 'excerpt') == 'excerpt' ) : ?>
    

    Replace it with this line then save:

    <?php if ( frontier_option('blog_display', 'excerpt') == 'excerpt' && !is_sticky() ) : ?>
    
    #8490

    Joseph Nirmal

    Thanks Ron for your valuable reply.

    How to make the sticky post background colour to white.

    #8513

    Joseph Nirmal

    How to limit 100 words in post excerpt??

    #8514

    Ron
    Keymaster
    #8550

    Joseph Nirmal

    Hi Ron

    I want to limit post excerpt without using additional plugin.

    Can I try a simple code like this? One of our theme used site limit the post excerpt to 100 words SEE – http://upcomingrailwayrecruitment.in/

    add these lines in function.php file

    function custom_excerpt_length( $length ) {
            return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 )
Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Word Limit for Post Excerpt in Home Page
Your information: