Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #2929344
elementor
Closed

Comments

  • maciek_l started the conversation

    Hi,

    How can I overwrite your Elementator widget?

    This is exactly about the file I need to modify:

    /soledad/inc/elementor/modules/penci-big-grid/widgets/based-post.php

    Can I overwrite it with a child theme? I tried to put it in my child theme along the same path but unfortunately it doesn't work.

    Or maybe I have to create my own widget based on yours?


    I'm waiting for help.


    Regards


  •  2,492
    PenciDesign replied

    Hi,

    Unfortunately, you can't overwrite the Soledad Elementor widget on your child theme.

    You can duplicate the "penci-big-grid" folder, rename and customize it as you want.

    Regards,
    PenciDesign.

  • maciek_l replied

    What else do I need to change? I tried to add a twin folder calling it for example penci-af-big-grid, but unfortunately this module doesn't show anywhere after that.

  •  2,492
    PenciDesign replied

    Hi,

    Can you tell me the reason why you need to modify the HTML code of this plugin?

    After duplicating the folder, you need to change the class name, functions name, register it on "wp-content/themes/soledad/inc/elementor/includes/modules-manager.php" and modify many things. You should have knowledge about PHP to customize it.

    Regards,
    PenciDesign.


  • maciek_l replied

    Hi,

    In style 20 "Big Grid", one photo is displayed vertically. Usually, a horizontal photo that is cropped vertically looks very ugly.
    Therefore, using the ACF plug, I created a field for an alternative photo vertically and I display it there using the following code:

    <?php if((penci_big_grid_count_classes( $bg, $biggid_style )==" bgitem-1") && !wp_is_mobile() && get_field('pionowe_zdjecie_wyrozniajace')) { ?>
                            <div class="penci-image-holder penci-lazy" <?php="" if(="" 'style-2'="=" $biggid_style="" ){="" echo="" '="" style="padding-bottom: '. penci_get_featured_image_padding_markup( get_the_ID(), $thumbnail, true ) .'%" ';="" }?=""> data-src="<?php echo wp_get_attachment_image_src(get_field('pionowe_zdjecie_wyrozniajace'), array('1170','780'))[0]; ?-->">
                            </div>
                            <!--?php } else { ?-->
                            <div class="penci-image-holder penci-lazy" <?php="" if(="" 'style-2'="=" $biggid_style="" ){="" echo="" '="" style="padding-bottom: '. penci_get_featured_image_padding_markup( get_the_ID(), $thumbnail, true ) .'%" ';="" }?=""> data-src="<!--?php echo penci_get_featured_image_size( get_the_ID(), $thumbnail ); ?-->">
                            </div>
                            <!--?php } ?-->
    

    This works, but unfortunately overwrites when updating the template. I would like to avoid it because now I have to remember to improve this code every update.


    Therefore, I would like to overwrite it somehow in the child theme. The method with changing any file in soledad will unfortunately not work.


    Regards

  •  2,492
    PenciDesign replied

    Hi,

    You should follow the document of Elementor here if you want to duplicate/add new the Elementor widgets/element: https://developers.elementor.com/creating-a-new-widget/

    Regards,
    PenciDesign.