The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
// In the case of a theme this goes in functions.php and for plugins I use plugin.php :) | |
function frontend_assets(){ | |
// Enqueue your assets here and add your localization like so! | |
wp_localize_script( $this->ssp_plugin_slug, 'ss_panel', array( | |
'success' => __( 'Here are your search results!', 'textdomain' ), | |
'failure' => __( 'Sorry, no results matched your search query. Try searching again?', 'textdomain' ), | |
)); | |
} | |
add_action( 'wp_enqueue_scripts', 'frontend_assets' ); | |
<?php | |
add_action('wp_head', 'webworks_facebook_analytics'); | |
function webworks_facebook_analytics() { | |
if(current_user_can('manage_options')) { | |
return; | |
} | |
?> |
<?php | |
function gp_child_scripts() { | |
wp_enqueue_style( 'gpchild-custom-css', get_theme_file_uri( '/customCss/modalStyling.css' ) ); | |
wp_enqueue_script( 'gpchild-custom-js', get_theme_file_uri( '/js/modalScript.js' ), array(), '4.8', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'gp_child_scripts' ); |
<?php // Leave this out if you already have an opening php tag in your file! | |
function elementor_accordion_title() { ?> | |
<script> | |
jQuery(document).ready(function() { | |
jQuery('.elementor-accordion-title').removeClass('active'); | |
jQuery('.elementor-accordion-content').css('display', 'none'); | |
}); | |
</script> | |
<?php } | |
add_action( 'wp_footer', 'elementor_accordion_title' ); |
<?php | |
add_action( 'woocommerce_product_options_advanced', 'woostore_elementor_product_link' ); | |
function woostore_elementor_product_link() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
woocommerce_wp_text_input( | |
array( |