-
AuthorPosts
-
August 10, 2014 at 7:04 pm #302280
Hi –
I found the great tutorial about using the Layout Builder in Custom Posts.
https://kriesi.at/support/topic/displaying-custom-post-types-inside-of-the-avia-layout-builder/Is there any easy way to do this with a Child Theme, or is it only possible to edit the meta.php file within config-template-builder in Enfold, which we would have to update everytime we update the enfold theme?
- This topic was modified 10 years, 4 months ago by blankonblank.
August 11, 2014 at 12:10 am #302321Hi blankonblank!
You can add this on the child theme’s functions.php.
add_filter('avf_builder_boxes','enable_boxes_on_posts'); function enable_boxes_on_posts($boxes) { $boxes[] = array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('page','post', 'portfolio'), 'context'=>'normal', 'expandable'=>true ); $boxes[] = array( 'title' =>__('Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('page','post', 'portfolio'), 'context'=>'side', 'priority'=>'low'); $boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('page','post','portfolio'), 'context'=>'normal', 'priority'=>'high' ); return $boxes; }
Note that we don’t recommend this modification because there are certain issues when using the ALB on posts.
Cheers!
IsmaelAugust 11, 2014 at 12:39 am #302330This reply has been marked as private.August 11, 2014 at 2:28 am #302355Hi!
I edited my last comment above. My mistake. You can use a filter to add the ALB on post. Issues are usually minor like featured image not working, contents might not be rendered as usual etc.
Best regards,
IsmaelAugust 11, 2014 at 3:36 am #302380so do i need to always make sure the change is made to meta.php file within config-template-builder or will the change to functions.php in my child theme do the trick?
August 11, 2014 at 2:21 pm #302612Hi!
Inserting code to functions.php file of your child theme should do the trick
Cheers!
YigitAugust 11, 2014 at 2:45 pm #302627perfect. and just confirming I put our slug in for “tribe_events” in the code above?
August 11, 2014 at 8:14 pm #302836Hey!
Yes, as long as that is the post type slug.
The issue with enabling the ALB on posts is a bit deeper since the output for the builder is in a separate meta field than the regular post data. So queries returned on content created with the builder show as blank.
Its a significant code change to make it universally usable but I know Kriesi has been looking into it a bit.
Best regards,
DevinAugust 11, 2014 at 8:49 pm #302862This reply has been marked as private.August 12, 2014 at 4:48 pm #303304That should work from the way you’ve described it. It shouldn’t be more than an hour to do a mock up on a dev site so you can test it out a bit.
If the “posts” don’t need to be actual WordPress posts then making them pages is definitely fine. The big reason I don’t like making the change for posts to use the ALB right now is that post data would not be transportable to a new theme later on and since most users tend to want to use the blog/post functionality as a true blog it can mean a lot of extra work later on.
August 12, 2014 at 4:55 pm #303311This reply has been marked as private.August 13, 2014 at 6:07 am #303656Hi!
I’ll ask the rest of the support team if they’re available for this particular task. You can also visit Envato Studio or Werkpress for further customization.
Cheers!
IsmaelAugust 13, 2014 at 4:04 pm #303900I freelance through Codeable.io when available.
August 18, 2014 at 4:10 pm #305811This reply has been marked as private.August 18, 2014 at 4:18 pm #305820Hey!
Devin replied you – https://kriesi.at/support/topic/layout-builder-and-custom-post-2/#post-303900
Cheers!
YigitAugust 18, 2014 at 4:24 pm #305827This reply has been marked as private.August 18, 2014 at 8:08 pm #305958Hi,
I’ve sent you a e-mail to see if i can help you out.
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.