Tagged: Custom Post Type
-
AuthorPosts
-
June 30, 2021 at 7:35 am #1308040
Hi Support
I’ve created a custom post type, and I try to display the results thanks to ALB Portfolio Grid or Masonry, but the entries aren’t displayed in the settings.
I knew I can use such code
/* to display advanced portfolio setting for gallery CPT */ 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('portfolio', 'page', 'post', 'mycpt'), 'context'=>'normal', 'expandable'=>true ); $boxes[] = array( 'title' =>__('Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('portfolio', 'page', 'post', 'mycpt'), 'context'=>'side', 'priority'=>'low'); $boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('portfolio'), 'context'=>'normal', 'priority'=>'high' ); return $boxes; }
But it doesn’t seem to work anymore. Is there a hook or a piece of code more suitable for the new versions of Enfold?
Thanks and have a nice dayJuly 1, 2021 at 11:54 am #1308301Hey Ikyo,
Thank you for the inquiry.
Instead of the previous code, try to use the filter that we provided in the following thread.
// https://kriesi.at/support/topic/custom-post-type-not-displaying-correctly/#post-1299723
Make sure to define the name of the post type where you need to enable the advance layout builder.
Best regards,
IsmaelJuly 1, 2021 at 5:56 pm #1308375Thank you for your quick and complete help.
Nevertheless, I added the code in functions.php placed in my child theme.I have of course customized it, but I don’t get the expected effect.
Did I forget something?
Many thanksJuly 5, 2021 at 9:18 am #1308728Hi,
The snippet that we recommended previously will only enable the advance settings for the post type. If you want to include the custom post type in the masonry or blog selection, you have to create a custom taxonomy for the custom post type and attach the terms or categories to your posts. You can then select the custom taxonomy to display the posts associated with it.
You can also add this code in the functions.php file to make the public post types selectable but we do not recommend it.
add_theme_support("add_avia_builder_post_type_option");
Best regards,
IsmaelJuly 14, 2021 at 11:53 am #1310103Thank you very much for your help always so precious Ismael !
If anyone has the same problem, the following code should be added to the CPT code
'taxonomies' => array( 'category' ),
July 16, 2021 at 3:43 am #1310337 -
AuthorPosts
- You must be logged in to reply to this topic.