Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1155723

    Hi,
    I’m working on a project where I want to add custom post types. I’ve created a shortcode in the must-use plugins folder to show those posts, but when I’m calling the_post(), the html of the theme changes, which causes the styling (also the responsiveness) to break.
    When I call the shortcode, the #wrap_all element contains the header, #main and full_slider, but everything else is located outside the #wrap_all element.

    #1156595

    Hey oreely,

    Thank you for the update.

    What is the name/slug of the new custom post type? You may need to use the following filter to include it in the list of the builders’ supported post types. The content structuring in the post should work properly afterwards.

    // https://kriesi.at/documentation/enfold/intro-to-layout-builder/#alb-for-any-post-type

    Best regards,
    Ismael

    #1156912

    Hi,

    The custom post type is called event. and I added it with this code:

    function custom_post_types() {
    register_post_type(‘event’, array(
    ‘public’ => true,
    ‘labels’ => array(
    ‘name’ => ‘Events’,
    ‘add_new_item’ => ‘Nieuw event toevoegen’,
    ‘new_item’ => ‘Nieuw event’,
    ‘edit_item’ => ‘Event bewerken’,
    ‘all_items’ => ‘Alle Events’,
    ‘singular_name’ => ‘Event’
    ),
    ‘menu_icon’ => ‘dashicons-calendar-alt’
    ));
    }
    add_action(‘init’, ‘custom_post_types’);

    I added the code you suggested:

    function avf_alb_supported_post_types_mod( array $supported_post_types )
    {
    $supported_post_types[] = ‘event’;
    return $supported_post_types;
    }
    add_filter(‘avf_alb_supported_post_types’, ‘avf_alb_supported_post_types_mod’, 10, 1);

    But the result is still the same.

    #1157740

    Hi,

    Thank you for the update.

    Looks like you’re not using the Advance Layout Builder for the event posts, so the filter above is not really necessary, but it could be useful in the future when you decided to use the builder. Anyway, we don’t really see any issue in the layout of the event items — there are only 3 items currently, so we’re able to check all of them. Where can we see the layout issue?

    Best regards,
    Ismael

    #1157990

    Hi,
    I am using the advanced layout builder. If you look on the homepage, you’ll find a codeblock with a shortcode.
    When you look at the website, you’ll see that the transparent menu is on top of a white section, uppercase titles aren’t uppercase, on mobile, the site isn’t responsive…
    (I just made 3 events just for testing and I want to add some more fields to the post type later on.)

    Best regards,
    Dirk

    #1158774

    Hi,

    Thank you for the clarification.

    We added the “avf_alb_exec_sc_only” filter in the functions.php file to allow rendering of shortcodes that are not directly added from the advance layout builder. The page should have the correct structure now.

    Best regards,
    Ismael

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