This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Don't include this line | |
| /** | |
| * Add new font group (Custom) to the top of the list | |
| */ | |
| add_filter( 'elementor/fonts/groups', function( $font_groups ) { | |
| $new_font_group = array( 'custom' => __( 'Custom' ) ); | |
| return array_merge( $new_font_group, $font_groups ); | |
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Elementor Custom Fonts | |
| * Source: https://merianos.wordpress.com/2017/09/22/elementor-register-custom-font-family-in-the-fonts-control/ | |
| */ | |
| function modify_controls( $controls_registry ) { | |
| // First we get the fonts setting of the font control | |
| $fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' ); | |
| // Then we append the custom font family in the list of the fonts we retrieved in the previous step |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Elementor\Controls_Manager; | |
| use Elementor\Element_Base; | |
| use Elementor\Core\Files\CSS\Post; | |
| use Elementor\Core\DynamicTags\Dynamic_CSS; | |
| // Exit if accessed directly | |
| if (!defined('ABSPATH')) { | |
| exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function reverse_wpautop( $string = '' ) { | |
| /* return if string is empty */ | |
| if ( trim( $string ) === '' ) | |
| return ''; | |
| /* remove all new lines & <p> tags */ | |
| $string = str_replace( array( "\n", "<p>" ), "", $string ); | |
| /* replace <br /> with \r */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| Add elmentor button widget | |
| Use link to # | |
| Set class in advanced to .facetwp-reset-btn https://d.pr/i/b05YIM | |
| Add following js, it can be added in an elementor html code widget (https://d.pr/i/Lat8Z4) | |
| if you don't have a theme/plugin setting or custom code you are using | |
| --> | |
| <script> | |
| (function($) { | |
| $(document).on('click', '.facetwp-reset-btn', function(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** re-adds elementor-has-item-radio afer refresh **/ | |
| add_action( 'wp_head', function() { ?> | |
| <script> | |
| (function($) { | |
| $(document).on('facetwp-loaded', function() { | |
| $('.facetwp-template .elementor-posts-container').addClass('elementor-has-item-ratio'); | |
| }); | |
| })(jQuery); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Aepro; | |
| use Elementor\Group_Control_Background; | |
| use Elementor\Group_Control_Box_Shadow; | |
| use Elementor\Widget_Base; | |
| use Elementor\Controls_Manager; | |
| use Elementor\Group_Control_Border; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This example will add a custom "select" drop down to the "Image Box" | |
| // This will change the class="" on the rendered image box so we can style the Image Box differently | |
| // based on the selected option from the editor. | |
| // The class will be "my-image-box-style-blue" or "my-image-box-style-green" based on the selected option. | |
| add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) { | |
| if( $section->get_name() == 'image-box' && $section_id == 'section_image' ){ | |
| // we are at the end of the "section_image" area of the "image-box" | |
| $section->add_control( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Adding custom icon to icon control in Elementor | |
| */ | |
| function modify_icon_controls($controls_registry) { | |
| //3696 material design icon classes | |
| $material_design_icons_cls = 'mdi mdi-access-point, mdi mdi-access-point-network, mdi mdi-access-point-network-off, mdi mdi-account, mdi mdi-account-alert, mdi mdi-account-alert-outline, mdi mdi-account-arrow-left, mdi mdi-account-arrow-left-outline, mdi mdi-account-arrow-right, mdi mdi-account-arrow-right-outline, mdi mdi-account-badge, mdi mdi-account-badge-alert, mdi mdi-account-badge-alert-outline, mdi mdi-account-badge-horizontal, mdi mdi-account-badge-horizontal-outline, mdi mdi-account-badge-outline, mdi mdi-account-box, mdi mdi-account-box-multiple, mdi mdi-account-box-outline, mdi mdi-account-card-details, mdi mdi-account-card-details-outline, mdi mdi-account-check, mdi mdi-account-check-outline, mdi mdi-account-child, mdi mdi-account-child-circle, mdi mdi-account-circle, mdi mdi-account-circle-outline, mdi mdi-account-clock, mdi mdi-account-clock- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) { | |
| if( $section->get_name() == 'section' && $section_id == 'section_layout' ){ | |
| $section->add_control( | |
| 'wpb_section_padding', | |
| [ | |
| 'label' => _x( 'Section Padding (top & bottom)', 'Section Control', 'wpb-plugins' ), | |
| 'type' => Elementor\Controls_Manager::SELECT, |