Well, you can't output content directly to your templates using VC shortcodes like this.
1. Problem:
For security, other than nonce, VC uses shortcode_id and shortcode_id to verify AJAX / response data.
shortcode_id automatically generated by VC, you cannot encode it.
For example, this is a short code that you see on the admin editor screen:
[vc_basic_grid post_type="post_type" max_items="10" item="masonryGrid_SlideFromLeft" grid_id="vc_gid:1458178666639-80ebf3775500c87d35de078c3422fe96-10" taxonomies="555"]
Let's say that the page id is 4269, this is the generated HTML code on the interface:
<div class="vc_grid-container-wrapper vc_clearfix"> <div class="vc_grid-container vc_clearfix wpb_content_element vc_masonry_grid" data-initial-loading-animation="zoomIn" data-vc-grid-settings="{"page_id":4269,"style":"all-masonry","action":"vc_get_vc_grid_data","shortcode_id":"1458178666639-80ebf3775500c87d35de078c3422fe96-10","tag":"vc_masonry_grid"}" data-vc-request="http://example.com/wp-admin/admin-ajax.php" data-vc-post-id="4269" data-vc-public-nonce="0641473b09"> </div> </div>
Now, if shortcode_id and shortcode_id do not match, {'status':'Nothing found - $shorcode_id'} will be thrown away and the content will not be displayed.
You can find out more inside the vc_grid.min.js file.
2. Solution:
- Create a fake page with VC, then copy the generated HTML code into your template file.
- Create a template directly using VC.
- Use the Shorcode Mapper to create your own shorcode.
source share