Support » Plugin: Advanced Excerpt » Allow "Insert Read More Tag" button to override everything

  • Resolved officeninjas

    (@officeninjas)


    I wanted to give contributors flexibility to add a “read more” link using the “Insert Read More Tag” button anywhere they want and have it override advanced excerpt.

    If this is what you want and are using the latest version 4.2.3 edit file advanced-excerpt.php under the class folder and make the following 3 changes:

    1) Change line 226

    Before

    if ( $the_content_no_break && false !== strpos( $post->post_content, ‘<!–more–>’ ) && ‘content’ == $this->filter_type ) {

    After

    $has_more_tag = (false !== strpos( $post->post_content, ‘<!–more–>’ ));
    if ( $the_content_no_break && $has_more_tag && ‘content’ == $this->filter_type ) {

    2) Change line 277

    Before

    $text = $this->text_excerpt( $text, $length, $length_type, $finish );

    After

    if (!$has_more_tag)
    $text = $this->text_excerpt( $text, $length, $length_type, $finish );

    3) Change line 280

    Before

    if ( !apply_filters( ‘advanced_excerpt_disable_add_more’, false, $text_before_trimming, $this->options ) ) {

    After

    if ( $has_more_tag || !apply_filters( ‘advanced_excerpt_disable_add_more’, false, $text_before_trimming, $this->options ) ) {

    https://wordpress.org/plugins/advanced-excerpt/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Allow "Insert Read More Tag" button to override everything’ is closed to new replies.