This topic has 7 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #157447
     fabianno0572
    Participant

    Hello,

    My website is dual lingual and when I post chinese language blog, it occupies too much space in the home page. How can I minimize the preview?

    Here is the image link. Please refer to the image for better understanding.

    http://mymassageinfo.com/wp-content/uploads/2017/04/1-1.png

    #157545
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #157725
     Radu
    Moderator

    Hi,

    Add this function to wp-content/themes/kleo-child/functions.php

    COPY CODE
    
    /*Fix chinesse characters on excerpt*/
    function sq_fix_excerpt_chinesse_characters($excerpt) {
        return mb_substr( $excerpt, 0, 10 );
    }
    
    add_filter('the_excerpt', 'sq_fix_excerpt_chinesse_characters', 99);
    

    Let me know

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #157727
     fabianno0572
    Participant

    I had uploaded.but it seems the same. No changes.
    Please check on the website : mymassageinfo.com

    #157829
     Radu
    Moderator

    Do you have kleo child theme installed and activated?
    If yes provide to me ftp login access and wp admin to take a closer look (in a private reply)
    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #158384
     fabianno0572
    Participant
    This reply has been set as private.
    #158684
     fabianno0572
    Participant

    Hello,
    Is there any update?

    #158945
     Radu
    Moderator

    Hi,

    Done,

    Please check it, limit can be changed from /wp-content/themes/kleo-child/functions.php

    Replace 350 with your desired number or characters

    Code below:

    COPY CODE
    
    if ( ! function_exists( 'kleo_excerpt' ) ) {
        function kleo_excerpt( $limit = 50, $words = false ) {
            /*Force excerpt length*/
            $limit = 350;
            $from_content    = false;
            $excerpt_initial = get_the_excerpt();
    
            if ( $excerpt_initial == '' ) {
                $excerpt_initial = get_the_content();
                $from_content    = true;
            }
            $excerpt_initial = preg_replace( '<code>\[[^\]]*\]</code>', '', $excerpt_initial );
            $excerpt_initial = strip_tags( $excerpt_initial );
    
            /* If we got it from get_the_content -> apply length restriction */
            if ( $from_content ) {
                $excerpt_length  = apply_filters( 'excerpt_length', $limit );
                $excerpt_initial = wp_trim_words( $excerpt_initial, $excerpt_length, '' );
            }
    
            if ( $words ) {
                $excerpt = explode( ' ', $excerpt_initial, $limit );
                if ( count( $excerpt ) >= $limit ) {
                    array_pop( $excerpt );
                    $excerpt = implode( " ", $excerpt ) . '...';
                } else {
                    $excerpt = implode( " ", $excerpt ) . '';
                }
            } else {
                $excerpt = substr( $excerpt_initial, 0, $limit ) . ( strlen( $excerpt_initial ) > $limit ? '...' : '' );
            }
    
            return '<p>' . $excerpt . '</p>';
        }
    }
    
    function kleo_new_excerpt_length( $length ) {
        return 350;
    }
    
    

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Ticket solution
Viewing 8 posts - 1 through 8 (of 8 total)

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

Log in with your credentials

Forgot your details?