WordPress.org

Ready to get started?Download WordPress

Forums

Strip Shortcodes (4 posts)

  1. TungstenKnight
    Member
    Posted 6 months ago #

    Hello
    I'm having just a little problem with my wordpress theme. When I make a post, the preview text is displayed containing the [caption] shortcode. I'd really like to remove this. I know you can use <?php strip_shortcodes( $content ); ?> to remove shortcodes, but I'm very bad at Php and can't get it to work in my theme.

    My theme contains this:

    # Removes tags and trailing dots from excerpt
    function dp_clean($excerpt, $substr=0) {
    	$string = strip_tags(str_replace('[...]', '...', $excerpt));
    	if ($substr>0) {
    		$string = substr($string, 0, $substr);
    	}
    	return $string;
    }

    I'm not sure how any of it works, but I need to include strip_shortcodes() in this function(I think).

    Any help is appreciated. Thank You!

  2. esmi
    Forum Moderator
    Posted 6 months ago #

    What theme are you using? Where did you download it from?

  3. TungstenKnight
    Member
    Posted 6 months ago #

    I'm using the Gemer theme, it's a little outdated, and I got it through WordPress on my site.

  4. TungstenKnight
    Member
    Posted 6 months ago #

    bump

Reply

You must log in to post.

About this Topic