Tagged: avia builder, custom post types, Include
-
AuthorPosts
-
April 17, 2015 at 5:17 pm #430452
Hi,
I see topic is closed but I think I missed something?
I followed the steps according to the video: https://kriesi.at/support/topic/displaying-custom-post-types-inside-of-the-avia-layout-builder/I added this in my child theme functions.php
add_filter('avf_builder_boxes', 'add_builder_to_posttype'); function add_builder_to_posttype($metabox) { foreach($metabox as &$meta) { if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout') { $meta['page'][] = 'movie'; /*instead add the name of the custom post type here*/ } } return $metabox; }
What did I miss? What folder should I make in my Child Theme?
Thanks !
April 20, 2015 at 4:24 pm #431391Hi Mariken!
You have a custom post type named “movie” and your trying to add our layout builder and other post options to it? You pasted that into the bottom of your child theme functions.php file? Are you sure the custom post type slug is “movie”?
Send us a WordPress login and we’ll take a closer look.
Regards,
ElliottApril 21, 2015 at 11:55 am #431902Yep!
Thanks. My mistake instead of the slug, I had the post type name.
And how (where) can I save the moderated file so it is parent -theme -upload-save?Regards,
MarikenApril 21, 2015 at 3:14 pm #432049Hey!
As long as your code is in functions.php file of your child theme, changes you make are update safe.
Cheers!
YigitApril 22, 2015 at 9:57 am #432657Hi Yigid,
Yes, I got that part. My concern is more about the changes made in the parent file : config-template-builder…….>meta.php, according to the video
Regards,
MarikenApril 22, 2015 at 3:06 pm #432851Hi!
Please refer to this post and move the file to your child theme – http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
Cheers!
YigitJune 10, 2017 at 8:20 pm #806359Hi there –
I used this code to add Avia to one CPT. How do I add it to multiple? I tried adding a completely new add_filter for the second CPT, but that crashed the site. Then, I tried adding the second CPT slug name into “$meta[‘page’][] = ‘2016-session’;” but that also crashed the site. Any ideas? Thanks!
June 13, 2017 at 12:06 pm #807396Hi websiteworkers,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look? And give us the code you tried?
Best regards,
VictoriaJune 13, 2017 at 4:39 pm #807562With some trial and error, I think I actually figured it out. Here’s the code I ended up with:
add_theme_support('avia_template_builder_custom_css'); /* Enfold's builder available on the individual session post types */ add_filter('avf_builder_boxes', 'add_builder_to_posttype'); function add_builder_to_posttype($metabox) { foreach($metabox as &$meta) { if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout') { $meta['page'][] = '2016-session'; /*name of CPT one*/ $meta['page'][] = '2017_session'; /*name of CPT two*/ } } return $metabox; }
June 14, 2017 at 7:05 am #807801 -
AuthorPosts
- You must be logged in to reply to this topic.