-
AuthorPosts
-
April 10, 2017 at 7:54 pm #775610
Hello!
I’m trying to add the builder to two custom post types with the code that I’ve found in some documentation (below)
When i add it to one post type it works great BUT i need to add the builder to another post type (two in total) and if I duplicate the code (and change the post type name) it brakes the site.How can I add the builder to two post types?
Thank you!
//avia builder to custom type post
add_filter('avf_builder_boxes', 'avia_register_meta_boxes', 10, 1); //Add meta boxes to custom post types function avia_register_meta_boxes($boxes) { if(!empty($boxes)) { foreach($boxes as $key => $box) { $boxes[$key]['page'][] = 'posttypename'; } } return $boxes; }
April 10, 2017 at 10:49 pm #775696Hi Gigi!
When duplicating the code, are you also changing the function name, or you are using the same?
Cheers!
BasilisApril 11, 2017 at 10:54 am #775934Thank you Basilis for your quick repsonse 🕺
Actually no… how can I do that? Here is the code that brakes the site//avia builder to residents add_filter('avf_builder_boxes', 'avia_register_meta_boxes', 10, 1); //Add meta boxes to custom post types function avia_register_meta_boxes($boxes) { if(!empty($boxes)) { foreach($boxes as $key => $box) { $boxes[$key]['page'][] = 'resident'; } } return $boxes; } //avia builder to faculty add_filter('avf_builder_boxes', 'avia_register_meta_boxes', 10, 1); //Add meta boxes to custom post types function avia_register_meta_boxes($boxes) { if(!empty($boxes)) { foreach($boxes as $key => $box) { $boxes[$key]['page'][] = 'faculty'; } } return $boxes; }
Thank you!!
April 11, 2017 at 12:53 pm #775978I have the same problem as above, and it seems, that the question about changing the function name is not answered??? I started at the documentation here, and read the article
Could be great, if you would explain in that article, how to ad the code for two or more custom post types!
April 12, 2017 at 4:10 am #776410 -
AuthorPosts
- You must be logged in to reply to this topic.