Multiple Post Types In Posts Widget: Elementor Pro

Elementor PHP July 23, 2026

This code is not mine. Original by ScratchCode, reproduced here with the credit intact.

Source: https://www.scratchcode.io/add-multiple-post-types-in-posts-widget-in-elementor/

……………………………………………………………………….

<?php
function elementor_posts_widget_multiple_post_types( $element, $args ) {
    $element->update_control(
        'posts_post_type', // control ID
        [
            'type' => ElementorControls_Manager::SELECT2,
            'multiple' => true,
        ]
    );
}
add_action( 'elementor/element/posts/section_query/after_section_end', 'elementor_posts_widget_multiple_post_types', 10, 2 );