• Hello

    Please, I’d like to know how can I limit the title length of the imported posts?

    I saw the code below, but I can’t figure out where to add it.

    Thanks

    James

    add_filter( 'dsgnwrks_instagram_pre_save', 'dsgnwrks_qa_make_title_excerpted' );
    function dsgnwrks_qa_make_title_excerpted( $import ) {
    
    if ( isset( $import['post_title'] ) ) {
    
    // feel free to edit these 2 values
    $number_of_words = 5;
    $more = '...';
    
    $import['post_title'] = wp_trim_words( $import['post_title'], $number_of_words, $more );
    }
    
    return $import;
    }

    https://wordpress.org/plugins/dsgnwrks-instagram-importer/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Title length’ is closed to new replies.