Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 !

    #431391

    Hi 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,
    Elliott

    #431902

    Yep!

    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,
    Mariken

    #432049

    Hey!

    As long as your code is in functions.php file of your child theme, changes you make are update safe.

    Cheers!
    Yigit

    #432657

    Hi 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,
    Mariken

    #432851

    Hi!

    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!
    Yigit

    #806359

    Hi 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!

    #807396

    Hi 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,
    Victoria

    #807562

    With 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;
    }
    #807801

    Hi,

    Great, glad you found a solution and thanks a lot for sharing, much appreciated :-)

    Best regards,
    Rikard

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.