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

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21406
    VelaAgency
    VelaAgency
    Participant

    ASP shortcode is present in the excerpts when viewing category archive pages. (ref: https://intranet.ptanc.com/category/facility-specific-scope-of-care/)

    Attachments:
    You must be logged in to view attached files.
    #21422
    Ernest Marcinko
    Ernest 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 '';
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21436
    VelaAgency
    VelaAgency
    Participant

    The worked perfectly. Thank you!

    KO

    #21437
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.