Remove Shortcodes on Archive page

Community Forums Forums Design Tips and Tricks Remove Shortcodes on Archive page

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  elliott 1 year, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8444

    elliott
    Participant
    Post count: 1

    Shortcodes are displaying as text on my blog archive pages in the summary. I have attempted to add the code below to the Functions.php for my Crystal Theme, however nothing I am trying is working. Anybody got any ideas?

    You can see the shortcode [HTML1} on the third post down on this page http://labaumemusic.com/category/portfolio/

    I have also tried: ” is_archive” “is_page_archive” “is_blog” “is_page_blog”

    CODEX – Function Reference/strip shortcodes – see below:

    function remove_shortcode_from_index($content) {
    if ( is_archive() ) {
    $content = strip_shortcodes( $content );
    }
    return $content;
    }
    add_filter(‘the_content’, ‘remove_shortcode_from_index’);

    #15096

    SoZo
    Moderator
    Post count: 1573

    You could enter custom excerpts


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #15701

    elliott
    Participant
    Post count: 1

    I do not know how to do that, can you provide an example of what you mean to exclude the short code [HTML1] from showing up as stated above?

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

You must be logged in to reply to this topic.