I'm using Visual Composer, but I think it has more to do with WordPress than VC ;-) I did a shortcode (with the VC API) to get the content of a post. Here it is (in functions.php):
add_filter( 'vc_grid_item_shortcodes', 'my_module_add_grid_shortcodes' );
function my_module_add_grid_shortcodes( $shortcodes ) {
$shortcodes['vc_post_id'] = array(
'name' => __( 'Post content', 'fluidtopics' ),
'base' => 'vc_post_content',
'category' => __( 'Content', 'fluidtopics' ),
'description' => __( 'Show current post content', 'fluidtopics' ),
'post_type' => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( 'vc_post_content', 'vc_post_content_render' );
function vc_post_content_render() {
return '{{ post_data:post_content }}';
}
The content is really rendered. The layout provided by VC is achieved through shortcodes too... which are not parsed and displayed with the content. I wonder if it's possible to get these shortcodes parsed ?
This can be viewed here: https://www.fluidtopics.com/whats-new-2/ (third tab, you'll see [vc_row] etc.)
Thanks a lot for any help !