Tagged: child theme, custom post types, Visual Composer
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
April 16, 2014 at 7:52 am #251960
I have created more CPT for my website, and I would like to use the Visual Builder on them. I know that to add this, I have to edit the meta.php and add those CPT to the array $boxes. But with every update I have to modify this files.
Is possible to hook it through the child theme? This is what I have modified in the meta.php
global $builder;
/* CUSTOM */ $boxes = array( array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('portfolio','page','post','distributors','discontinued'), 'context'=>'normal', 'priority'=>'high', 'expandable'=>true ), array( 'title' =>__('Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('portfolio', 'page' , 'post','distributors','discontinued'), 'context'=>'side', 'priority'=>'low'), array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('portfolio','distributors','discontinued'), 'context'=>'normal', 'priority'=>'high' ), ); $boxes = apply_filters('avf_builder_boxes', $boxes);
Thank you.
April 16, 2014 at 9:02 am #251980Hi Pedro!
You can use that filter right below:
$boxes = apply_filters('avf_builder_boxes', $boxes);
Cheers!
DevinApril 16, 2014 at 9:29 am #251989That options didn’t worked. Anyways, I found the way how to do it. I post it if somebody need it also:
add_filter('avf_builder_boxes','custom_post_types_options'); function custom_post_types_options($boxes) { $boxes[] = array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('custom_post_type1','custom_post_type2','custom_post_type3'), 'context'=>'normal', 'expandable'=>true ); $boxes[] = array( 'title' =>__('Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('custom_post_type1','custom_post_type2','custom_post_type3'), 'context'=>'side', 'priority'=>'low'); $boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('custom_post_type1','custom_post_type2','custom_post_type3'), 'context'=>'normal', 'priority'=>'high' ); return $boxes; }
Replace ‘custom_post_type1′,’custom_post_type2′,’custom_post_type3’ with the name of your own custom post types ;)
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Add Builder to other custom post types’ is closed to new replies.