Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1487920

    I’m using the CPT UI plugin to add a custom post type to my site. That is working fine and it is setup, but what I’m trying to achieve is to have the Layout feature show so I can have a custom side bar for the posts that I will be adding to this custom post type. For example, in the Portfolio Items section of the site, that is a custom post type and we do see Layout as an option for that post type. How can this be done using CPT UI, or if there is a snippet of code to use for this, let me know. Note – in the CPT UI setup, there is something to add Custom Supports, and it asks to add the slug. I tried to use the slug: layout, but that didn’t do anything. Thanks.

    #1487950

    Hey ronduring,

    Thank you for the inquiry.

    You may need to add your custom post type (CPT) to the list of post types supported by the Advanced Layout Builder. Please refer to this documentation for more info: https://kriesi.at/documentation/enfold/intro-to-layout-builder/#alb-for-any-post-type

    Best regards,
    Ismael

    #1487981

    Thanks Ismael.
    I was able to add the custom post type, and ALB is working with it. What is missing is the Layout feature that you see for Pages, Posts and Portfolio Items. See shared screenshots for examples of what is needed for the Layout feature box that I need. I also sent an image of what CPT UI needs to add it to the custom post type.

    #1488005

    Hi,

    Thank you for the update.

    Try to add this filter to the functions.php file — making sure to adjust the post type name.

    add_filter('avf_metabox_layout_post_types', 'avf_metabox_layout_post_types_mod', 10, 1);
    function avf_metabox_layout_post_types_mod( array $supported_post_types ) {
         $supported_post_types[] = 'your-cpt';
         return $supported_post_types;
    }

    Let us know the result.

    Best regards,
    Ismael

    #1488143

    Thanks, that code worked perfectly for what was needed.

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