与内容

问题描述:

内VC页面构建代码显示WordPress的页面外环线我使用WordPress一个外部网站 (与require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');与内容

我想加载一个特定的页面,并显示里面的内容。

$post = get_post(467, OBJECT); 

$content = $post->post_content; 
$content = apply_filters('wpautop', $content); 
$content = str_replace(']]>', ']]>', $content); 
setup_postdata($post); 

...

<article id="post-<?php the_ID(); ?>"> 
    <div class="entry-content"> 
    <?php echo $content; ?> 
    <?php wp_link_pages(array(
         'before' => '<div class="page-links">' . esc_html__('Pages:', 'tm-polygon'), 
         'after' => '</div>', 
         )); 
    ?> 
    </div> <!-- .entry-content --> 
</article><!-- #post-## --> 

...

的问题是:该网页内容是通过视觉作曲家页面构建插件构建和输出是普通的vc代码,而不是呈现内容。

像:[vc_row full_width="stretch_row" css=".vc_custom_1472216323117{margin-top: 0px !important;margin-bottom: 50px !important;padding-top: 170px !important;padding-bottom: 165px !important;background-image: url(http://wp.netzexperten.org/wp-content/uploads/2015/09/section14.jpg?id=469) !important;background-position: center !important;background-repeat: no-repeat !important;background-size: cover !important;}"][vc_column][vc_column_text el_class="section-title" css=".vc_custom_1443428582908{margin-top: -25px !important;margin-bottom: 0px !important;}"]

我希望你能帮助我,克里斯

请尝试这个

<?php echo do_shortcode($post->post_content); ?> 

OR

<?php echo do_shortcode(get_post_field('post_content', $yourpostid)); ?> 
+0

THX您的快速反应。但是,这将输出相同的不渲染的视觉作曲家代码 – chrisdapos

+0

我通过functions.php创建一个新的短代码,并将新的短代码添加到页面。新的简码将被正确渲染。只有vc简码保持纯文本。 – chrisdapos

得到它的工作:

WPBMap::addAllMappedShortcodes(); 
echo apply_filters('the_content', $post->post_content); 

要注册的VC简码以下必须调用:

WPBMap::addAllMappedShortcodes();