Last updated on October 18, 2023

Elementor missing column handle

Don’t know where to add this snippet? Read our guide: How to add code snippets.

Retrieve missing column handles in Elementor.

The Elementor page builder is a popular tool for creating custom layouts in WordPress. One common issue that users may encounter is the missing column handle in Elementor. The column handle is the small icon that appears when you hover over a column, allowing you to drag and resize it. If the column handle is missing, it can be frustrating to make adjustments to your layout.

To fix this issue, you can add a custom JavaScript code snippet to your WordPress theme or child theme. This code snippet will add the missing column handle to the Elementor editor.

Here’s an example of how you can add the missing column handle in Elementor:

(function($) {
    $(document).on('elementor:init', function() {
        var handle = '<div class="elementor-column-handle"></div>';

        // Add column handle to existing columns
        $('.elementor-column-wrap').prepend(handle);

        // Add column handle to new columns
        $(document).on('click', '.elementor-add-column', function() {
            $(this).closest('.elementor-column-wrap').prepend(handle);
        });
    });
})(jQuery);

This code snippet uses jQuery to add the missing column handle to both existing columns and new columns added in Elementor. It targets the .elementor-column-wrap class, which is the container for each column in Elementor. The prepend() function is used to add the elementor-column-handle div element at the beginning of each column.

To implement this code snippet, you can add it to your theme’s JavaScript file or create a new JavaScript file and enqueue it in your theme’s functions.php file using the wp_enqueue_script() function.

Please note that modifying the Elementor editor functionality may require some knowledge of JavaScript and WordPress development. It’s always recommended to create a child theme and make modifications there to avoid losing changes during theme updates.

Examples

Example #1: Adding a missing column handle in Elementor

This use case demonstrates how to add a missing column handle in Elementor using a custom PHP function.

function wpsnippets_add_missing_column_handle( $handles ) {
    $handles['column'] = 'Column';
    return $handles;
}
add_filter( 'elementor/elements/column/handles', 'wpsnippets_add_missing_column_handle' );

In this code example, we define a custom PHP function wpsnippets_add_missing_column_handle that adds a missing column handle in Elementor. We use the elementor/elements/column/handles filter hook to modify the existing handles array. The function returns the modified handles array with the added column handle.

Example #2: Modifying an existing column handle in Elementor

This use case demonstrates how to modify an existing column handle in Elementor using a custom PHP function.

function wpsnippets_modify_column_handle( $handles ) {
    $handles['column'] = 'Modified Column';
    return $handles;
}
add_filter( 'elementor/elements/column/handles', 'wpsnippets_modify_column_handle' );

In this code example, we define a custom PHP function wpsnippets_modify_column_handle that modifies an existing column handle in Elementor. We use the elementor/elements/column/handles filter hook to access the handles array and make the necessary modification. The function returns the modified handles array with the updated column handle.

Example #3: Removing a column handle in Elementor

This use case demonstrates how to remove a column handle in Elementor using a custom PHP function.

function wpsnippets_remove_column_handle( $handles ) {
    unset( $handles['column'] );
    return $handles;
}
add_filter( 'elementor/elements/column/handles', 'wpsnippets_remove_column_handle' );

In this code example, we define a custom PHP function wpsnippets_remove_column_handle that removes a column handle in Elementor. We use the elementor/elements/column/handles filter hook to access the handles array and unset the specific column handle. The function returns the modified handles array without the removed column handle.

Last updated on October 18, 2023. Originally posted on November 10, 2023.

Leave a Reply

Your email address will not be published. Required fields are marked *