• mrdumont

    (@mrdumont)


    The ‘single’ page type automatic exclusion causes problems in some common situations. For example, creating a page with an Elementor ‘Posts’ widget will place a list of posts on the page. However, Advanced Excerpt filters will not have been setup due to the page type. Calling the advanced_excerpt() function directly isn’t a solution as it would require mods to Elementor.

    Would it be possible to add an option to Advanced Excerpt to turn off the ‘singular’ page type exclusion?

    Love the plugin – thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPKube

    (@wpkube)

    Hi,

    We’ll need to figure out a solution for that, simply removing the exclusion would cause issues since it also filters the_content().

    We’ll test it out specifically with Elementor, if it’s using the_excerpt() and not the_content() then it simplifies things quite a bit.

    Thread Starter mrdumont

    (@mrdumont)

    Thanks, that’s great! The Elementor widget that I’m using is Posts (Elementor Pro). If you look at plugins>Elementor-pro>modules>posts>skins>skin-base.php you will see at line 859 it’s outputting the_excerpt(). I did not find any references to the_content() when I searched the code for the Posts widget.

    Plugin Author WPKube

    (@wpkube)

    That’s good news.

    I’ve planned on handling the update on Monday (releasing on Friday is a bit tricky). But since you seem to know your way around code, you can give it a try.

    File: class/advanced-excerpt.php
    Line: 90

    Just move that line:

    if ( !empty( $page_types ) && !empty( $page_type_matches ) ) return;

    To be after the filters on the excerpt:

    if ( 1 == $this->options['the_excerpt'] ) {
    	remove_all_filters( 'get_the_excerpt' );
    	remove_all_filters( 'the_excerpt' );
    	add_filter( 'get_the_excerpt', array( $this, 'filter_excerpt' ) );
    }

    So basically the filter on get_the_excerpt applies regardless of the singular page being shown, and the_content filter does not apply.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘‘singular’ page type exclusion’ is closed to new replies.