Okay
  Public Ticket #1970552
Add CustomPostType at Elementor Posts
Closed

Comments

  • hongkyeongtae started the conversation

    hi 

    i want to add Add CustomPostType at Elementor Posts

    'post' => __('Post', 'neuron-core'),
                        'portfolio' => __('Portfolio', 'neuron-core'),
                        'product' => __('Product', 'neuron-core')

    I can only use that three types at the moment, but I want to add one type and print it in grid format like a theme. Do you have any related documents? I'd appreciate it if you could let me know if you could be
    Also, if we modify the neuron core directly, we will have a problem with the theme update. How do I create the neuron core plug-in in my Child theme?

    Please refer to the attached image.

    I want to add a new type like the red square in the image.

    Thank you.

  •  675
    Neuron replied

    Hi,

    Unfortunately, the Neuron Core is created with Elementor standards, and they do not allow to extend directly the elements, we'll look something in the future, but for the moment that's how it is, you need to edit directly on the plugin.

    How to add a Custom Post Type.

    1) Create the Custom Post Type, via a plugin or manually in the functions.php of the child theme.

    // Custom Post Type
    function neuron_books_post_type() {     // Post Type
        $labels = array(
            'name'                  => __('Books', 'neuron-core'),
            'singular_name'         => __('Books Item', 'neuron-core'),
            'menu_name'             => _x('Books', 'admin menu', 'neuron-core'),
            'name_admin_bar'        => _x('Books Item', 'add new on admin bar', 'neuron-core'),
            'add_new'               => __('Add New Item', 'neuron-core'),
            'add_new_item'          => __('Add New Books Item', 'neuron-core'),
            'new_item'              => __('Add New Books Item', 'neuron-core'),
            'edit_item'             => __('Edit Books Item', 'neuron-core'),
            'view_item'             => __('View Item', 'neuron-core'),
            'all_items'             => __('All Books Items', 'neuron-core'),
            'search_items'          => __('Search Books', 'neuron-core'),
            'parent_item_colon'     => __('Parent Books Item:', 'neuron-core'),
            'not_found'             => __('No books items found', 'neuron-core'),
            'not_found_in_trash'    => __('No books items found in trash', 'neuron-core'),
            'filter_items_list'     => __('Filter books items list', 'neuron-core'),
            'items_list_navigation' => __('Books items list navigation', 'neuron-core'),
            'items_list'            => __('Books items list', 'neuron-core')
        );     $supports = array(
            'title',
            'editor',
            'excerpt',
            'thumbnail',
            'comments',
            'author',
            'custom-fields',
            'revisions',
        );     $args = array(
            'labels'          => $labels,
            'supports'        => $supports,
            'public'          => true,
            'capability_type' => 'post',
            'rewrite'         => array('slug' => 'books'), // Permalinks format
            'menu_position'   => 5,
            'menu_icon'       => (version_compare( $GLOBALS['wp_version'], '3.8', '>=')) ? 'dashicons-portfolio' : false,
            'has_archive'     => false
        );
        
        register_post_type('books', $args);
    }

    2) Open the base.php in the neuron-core > includes > posts > base.php.

    3) In the base.php add your custom post types in the setting called 'posts_type' which is located in the line 89. http://prntscr.com/nag3kh

    4) In the line 2955 of the base.php you need to add your custom post type in the switch as the following screenshot. http://prntscr.com/nag49v

    case 'books':
        $neuron_posts_type = 'books';
        $neuron_posts_name = 'blog';
        $neuron_posts_taxonomy = 'category';
        $neuron_posts_normal_query = $settings['posts_query_normal_post'];
        $neuron_posts_metro_query = $settings['posts_query_metro_post'];
        $neuron_posts_wrapper_class = 'l-blog-wrapper';
        $neuron_posts_holder_class = 'l-blog-wrapper__posts-holder l-blog-wrapper__posts-holder--'. $settings['posts_layout_model'] .'';
        $neuron_posts_item_class = 'o-blog-post';
        break;

    Feel free to ask for anything you need.

    Kind Regards,
    NeuronThemes


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • hongkyeongtae replied

    Thank you for your kind reply.

    I think what you've explained is how you add new CPT as you create it.

    I want to add the existing CPT. ex) bbpress

    Can I get some more help?
    Thank you.

  •  675
    Neuron replied

    Simply skip the first step, and start from the second step. In the first step we create a new custom post type, so in your case you have already created.

    Feel free to ask for anything you need.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.