This file contains 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
/** | |
* https://docs.elementor.com/article/286-speed-up-a-slow-site | |
* | |
* Note: By default, Font Awesome icons will only load on the pages where you've used them, so FA won't load on pages that aren't using any Font Awesome icons. This brings faster performance and faster page speed to your site, which can benefit your SEO and your users' experience. Only the CSS and fonts of the icon family you actually use are loaded. So only dequeue Font Awesome if you truly plan to not use any Font Awesome icons at all. If you dequeue Font Awesome, the icons will no longer show on any of your pages | |
* | |
*/ | |
// Elementor - Remove Font Awesome | |
add_action( 'elementor/frontend/after_register_styles',function() { | |
foreach( [ 'solid', 'regular', 'brands' ] as $style ) { |
This file contains 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
/** | |
* Widget - Site Logo | |
* Extend Site Logo to create SVG control option with height | |
* | |
* | |
* @since 1.0.2 | |
* @access public | |
* | |
*/ | |
add_action( 'elementor/element/theme-site-logo/section_image/after_section_start', function( $element, $section_id ) { |
This file contains 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
## Custom Post Type | |
- Products | |
### Taxonomies | |
- Types | |
-- Term examples: Milkshakes, Sundaes, Cones | |
- Flavors | |
-- Term Examples: Chocolate, Vanaila, Mint Chip |
This file contains 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, | |
'options' => [ | |
'default' => _x( 'Default', 'Section Control', 'wpb-plugins' ), |
This file contains 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 custom spacing (margin and padding) controls to Elementor's Column_Element and Section_Element | |
* This hook means "run this function before you add the control section named 'section_advanced' on | |
* the element 'column' or 'section'. | |
*/ | |
add_action( 'elementor/element/column/section_advanced/before_section_start', 'add_custom_spacing_controls' ); | |
add_action( 'elementor/element/section/section_advanced/before_section_start', 'add_custom_spacing_controls' ); | |
/** |
This file contains 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 | |
// Hide Elementor sections / elements when acf field is empty. Everything is shown when editor is active | |
// Usage: Add acf__[field_slug] classname into the desired element (for example acf__caption, acf__map-section) | |
$all_acf_fields = get_fields(); | |
echo '<style>'; | |
foreach($all_acf_fields as $acf_field_slug => $acf_field_value) { | |
if ($acf_field_value == ''){ | |
echo 'body:not(.elementor-editor-active) .acf__'.$acf_field_slug.' { display: none; }'; | |
} | |
}; |
This file contains 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
/** | |
* Spacer | |
* | |
* @since 1.3.0 | |
* Use the shortcode: [spacer class="css-class-name" height="30px"] | |
* Note: Since the space size uses an inline style your css class may have to use an !important | |
*/ | |
function cmms_spacer_shortcode( $atts ) { | |
// Attributes |
This file contains 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
/* | |
* https://ben.lobaugh.net/blog/202432/prevent-wordpress-plugins-from-requesting-updates | |
* Be sure to change [plugin_folder]/[plugin_file].php to the plugin you want to prevent updating. | |
*/ | |
add_filter( 'site_transient_update_plugins', array( 'no_updates_for_you' ) ); | |
function no_updates_for_you( $value ) { |
This file contains 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
// Register Custom Post Type | |
function cmms_testimonial_post_type() { | |
$labels = array( | |
'name' => _x( 'Testimonials', 'Post Type General Name', 'cmms' ), | |
'singular_name' => _x( 'Testimonial', 'Post Type Singular Name', 'cmms' ), | |
'menu_name' => __( 'Testimonials', 'cmms' ), | |
'name_admin_bar' => __( 'Testimonial', 'cmms' ), | |
'archives' => __( 'Item Archives', 'cmms' ), | |
'parent_item_colon' => __( 'Parent Item:', 'cmms' ), |
This file contains 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
//For this to work you need to change the body tag to look like this: | |
//<body <?php body_class() ?>> | |
function add_body_classes( $classes ) { | |
// Adds a class if post type is books | |
if ( is_singular('book') ) { | |
$classes[] = 'book-single'; | |
} | |
// add class if not home page | |
if ( ! is_home() ) { |
NewerOlder