This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: ASP shortcode showing in excerpts of Cat Archive Pages

Home Forums Product Support Forums Ajax Search Pro for WordPress Support ASP shortcode showing in excerpts of Cat Archive Pages Reply To: ASP shortcode showing in excerpts of Cat Archive Pages

#21422
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

It’s because the search plugin is actually included within each post as the post content, see: https://i.imgur.com/zOYm0Ti.png

I am not sure if that is possible to remove, as it is within the post content, and the excerpt is automatically generated on those pages. Maybe via a custom code, but I am not sure if that does anything.

Try add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

add_action('wp_head', 'asp_shortcode_unset_archive');
function asp_shortcode_unset_archive() {
    if ( is_archive() ) {
        add_shortcode('wd_asp', 'asp_empty_sc');
        add_shortcode('wpdreams_ajaxsearchpro', 'asp_empty_sc');
    }
}
function asp_empty_sc() {
    return '';
}