Support » Plugin: Elementor Website Builder » Elementor not loading for custom post type

  • Hi there,
    As the title says, I have a custom post type setup and I’m not able to get Elementor to load when editing it.
    – I have the post type checked in Elementor general settings
    – The CPT is being registered in my plugin like this:

    
    //Register Post Type
    function portfolio_type_register() {
        $labels = array(
            'name'               => __('Portfolio Items'),
            'singular_name'      => __('Portfolio Item'),
            'add_new'            => __('Add New'),
            'add_new_item'       => __('Add New Portfolio Item'),
            'edit_item'          => __('Edit Portfolio Item'),
            'new_item'           => __('New Portfolio Item'),
            'view_item'          => __('View Portfolio Item'),
            'search_items'       => __('Search Portfolio Item'),
            'not_found'          => __('No Portfolio Items found'),
            'not_found_in_trash' => __('No Portfolio Items found in Trash'),
            'parent_item_colon'  => '',
            'menu_name'          => __('Portfolio')
        );
    
        $rewrite = array(
            'slug'       => 'portfolio',
            'with_front' => true,
            'pages'      => true,
            'feeds'      => true,
        );
    
        $args = array(
            'labels'               => $labels,
            'supports'             => array('title', 'editor', 'author', 'thumbnail', 'page-attributes'),
            'taxonomies'           => array('portfolio_category'),
            'capability_type'      => 'post',
            'hierarchical'         => true,
            'public'               => true,
            'show_ui'              => true,
            'show_in_menu'         => true,
            'menu_position'        => 20,
            'show_in_admin_bar'    => true,
            'show_in_nav_menus'    => true,
            'can_export'           => true,
            'has_archive'          => true,
            'query_var'            => true,
            'exclude_from_search'  => false,
            'publicly_queryable'   => true,
            'register_meta_box_cb' => 'ep_add_portfolio_metaboxes',
            'menu_icon'            => 'dashicons-portfolio',
            'rewrite'              => $rewrite
        );
        register_post_type('portfolio', $args);
    }
    add_action('init', 'portfolio_type_register',0);
    

    – And I added this to make the content public:

    add_filter('content_block_post_type','filter_content_block_init');
    
    function filter_content_block_init() {
        $content_block_public = true;
        return $content_block_public;
    }

    -I’m using a custom details page where I’m calling “the_content();”

    Any help would be appreciated.
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Elementor not loading for custom post type’ is closed to new replies.