• Resolved EntarteteMuzak

    (@entartetemuzak)


    Hi,
    First of all, great plugin. Saved my ass from hard coding columns in HTML.

    Now, if I want to strip the short code from the content or excerpt in such cases where it is not preferable two have columns, how do I go about doing that?

    I’ve tried <?php remove_all_shortcodes('the_content') ; the_content(); ?> but without success. That just leaves [col-sect] and [column] embedded in the post.

    Suggestions?

    http://wordpress.org/extend/plugins/wp-columnize/

Viewing 1 replies (of 1 total)
  • Thread Starter EntarteteMuzak

    (@entartetemuzak)

    Fixed it with this:

    in Functions

    <?php
    add_filter( 'the_excerpt', 'remove_columns' );
    function remove_columns( $excerpt ) {
    	return preg_replace ("/\[(\S+)\]/e", "", $excerpt);
    }?>

    In template:
    <?php remove_all_shortcodes('the_excerpt') ; the_excerpt(); ?>

    The only thing that ticks me is that the […] after the excerpt disappears if I use this technique on the excerpt.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WP Columnize] Remove shortcode from content?’ is closed to new replies.