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
/* --------------------------------------------------------------------------- | |
* Force Elementor Library to use Canvas Template | |
* - this gist file name can also be used in your theme to override the template instead of this | |
* --------------------------------------------------------------------------- */ | |
function get_elementor_library_post_type_template( $single_template ) { | |
global $post; | |
if ($post->post_type == 'elementor_library') { | |
$single_template = WP_PLUGIN_DIR . '/elementor/includes/page-templates/canvas.php'; | |
} |
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
/* | |
* adding a cpt and registering on theme activation w/ elementor support | |
* | |
*/ | |
//most basic add of cpt | |
function codex_custom_init() { | |
$args = array( | |
'public' => true, | |
'label' => 'Portfolios' | |
); |
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
/** | |
* add custom widget to switch city page map preferences | |
* | |
* Simply performs an audit on City Pages to check if | |
* the preference is to output custom code or use the | |
* automatic map search by city name | |
* | |
**/ | |
class Custom_City_Map_Widget extends WP_Widget { | |
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 | |
/** | |
* Plugin Name: Diamond Member Redirect Shortcode | |
* Plugin URI: http://wordpress.org | |
* Description: This plugin checks conditions and if diamond member will redirect to specified url, use [diamond_redirect] on any page/post | |
* Version: 1.0 | |
* Author: Some dude | |
**/ | |
//check for shortcode in content "before" sent to browser |
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
/*** | |
* Button - Get Most Recent Post by Category | |
* | |
* usage: | |
* [get_button_recent_post_by_cat $atts] | |
* | |
* atts ex: | |
* align="center" i.e.(left, right) | |
* bg_color="white" i.e. #000 | |
* border="1px solid black !important" |
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
/** | |
* Add rendering of shortcodes in Elementor Slides widget | |
* | |
* Simply renders shortcodes in slide content | |
* | |
**/ | |
add_action( 'elementor/widget/render_content', function( $content, $widget ) { | |
if ( 'slides' === $widget->get_name() ) { | |
$content = do_shortcode( $content ); | |
} |
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
/** | |
* Override the parent theme misc.js script. | |
* | |
* fix for Elementor popup forms due to | |
* issue w/ Bold Themes Medicare theme | |
*/ | |
function boldtheme_deregister_script() { | |
if( is_page( array( 'mypage', 'myotherpage' ) ) ){ | |
wp_deregister_script( 'boldthemes_misc_js' ); | |
wp_register_script( 'boldthemes_misc_js', get_stylesheet_directory_uri() . '/scripts/misc.js', array( 'jquery' ), null, false ); |
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
#gradient { | |
background: linear-gradient(-45deg,#ee7752,#e73c7e,#23a6d5,#23d5ab); | |
background-size: 400% 400%; | |
-webkit-animation: Gradient 15s ease infinite; | |
-moz-animation: Gradient 15s ease infinite; | |
animation: Gradient 15s ease infinite; | |
} | |
@-webkit-keyframes Gradient { | |
0% { | |
background-position: 0 50% |
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 | |
/** | |
* see - https://digwp.com/2019/07/better-inline-script/ | |
* by - Jeff Starr | |
*/ | |
// enqueue scripts | |
function shapeSpace_enqueue_scripts() { | |
wp_enqueue_script('shapeSpace_script', get_template_directory_uri() .'/js/script.js', array(), '1.0', true); |
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
add_action( 'elementor_pro/forms/new_record', function( $record ) { | |
// Make sure this is the correct form | |
$form_name = $record->get_form_settings( 'form_name' ); | |
if ( 'YOUR_ACTUAL_FORM_NAME_HERE' !== $form_name ) { | |
return; | |
} | |
$submmited_fields = $record->get( 'fields' ); | |
// Ref: https://developers.mailerlite.com/v2/reference#create-a-subscriber | |
$fields = [ |