从WordPress Visual Composer隐藏提要中的短代码

从WordPress Visual Composer隐藏提要中的短代码,wordpress,shortcode,Wordpress,Shortcode,我正在编辑使用VisualComposer的WordPress主题。在主页上,我将自己的自定义新闻提要集成到VisualComposer中 我使用Insert PHP插件将PHP添加到Visual Composer中: [insert_php]include('rm_news_feed.php');[/insert_php] rm_news_feed.php: <div class="vc_row wpb_row vc_row-fluid"> <div class="vc_c

我正在编辑使用VisualComposer的WordPress主题。在主页上,我将自己的自定义新闻提要集成到VisualComposer中

我使用Insert PHP插件将PHP添加到Visual Composer中:

[insert_php]include('rm_news_feed.php');[/insert_php]
rm_news_feed.php:

<div class="vc_row wpb_row vc_row-fluid">
<div class="vc_col-sm-12 wpb_column vc_column_container ">

    <div class="wpb_wrapper">

        <div class="bg_parallax ">
            <div class="">
                <div class="vc_row wpb_row vc_inner vc_row-fluid">
                    <div class="inner-row clearfix">

                        <?php query_posts('cat=1&posts_per_page=3&orderby=desc'); ?>
                        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

                            <?php 
                            if(has_post_thumbnail($post->ID)){ 
                                $thumbsrc = get_the_post_thumbnail($post->ID,'medium');
                            }else{
                                $thumbsrc = "<img src=\"images/no_featured_image.jpg\" alt=\"" . get_the_title() . "\">";
                            }

                            ?>

                            <div class="vc_col-sm-4 wpb_column vc_column_container ">
                                <div class="wpb_wrapper">
                                    <article class="ts-service-style3 ">
                                        <a href="<?php the_permalink(); ?>"><figure><?php echo $thumbsrc; ?></figure></a>
                                        <a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a><p><?php the_excerpt(); ?></p>
                                    </article>
                                </div> 
                            </div>

                        <?php endwhile; endif; ?>
                        <?php wp_reset_query(); ?>

                    </div>
                </div>
            </div>
        </div>

    </div>

</div> 
这并没有消除短代码


我可以在这里做什么?

插入PHP和Visual Composer似乎存在兼容性问题

作为解决方案,我停用并删除了Insert PHP插件,而是安装了它


现在它工作得很好

插入PHP和VisualComposer似乎存在兼容性问题。
$content = the_excerpt();
$content = preg_replace("/\[(.*?)\]/i", '', $content);
$content = strip_tags($content);