Strip Shortcodes (4 posts)

  1. TungstenKnight
    Posted 1 year ago #

    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 1 year ago #

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

  3. TungstenKnight
    Posted 1 year ago #

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

  4. TungstenKnight
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Topic