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 | |
/** | |
* Replace the default Avada Breadcrumbs with the Yoast SEO Breadcrumbs. | |
* Overrides the parent theme's themefusion_breadcrumb() function. | |
*/ | |
function themefusion_breadcrumb() { | |
// Early exit if the yoast_breadcrumb() function does not exist | |
if ( ! function_exists( 'yoast_breadcrumb' ) ) { |
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
if(is_multisite()) { | |
$uploads = wp_upload_dir(); | |
wp_register_style('options', $uploads['baseurl'] . '/options.css', 'style'); | |
} else { | |
wp_register_style('options', get_template_directory_uri() . '/css/options.css', '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
/** | |
* | |
* Filter the post thumbnail html adding a javascript onload attribute. | |
* | |
* @param html(string) | |
* @return string | |
*/ | |
function filter_thumbnail_html($html, $attr = false) { | |
if (empty($html)) return $html; |
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 | |
// Use minified libraries if SCRIPT_DEBUG is turned off | |
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
wp_enqueue_script( 'my-script-handle', plugin_dir_url( __FILE__ ) . 'assets/my-file' . $suffix . '.js', array( 'jquery' ) ); |
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
// Smooth Scroll | |
$('a[href*="#"]:not([href="#"])').click(function () { | |
var target = $(this.hash); | |
if (target.length) { | |
var isInternalLink = new RegExp('/' + window.location.host + '/'); | |
if (isInternalLink.test(this.href)) { | |
$('html, body').animate({scrollTop: target.offset().top}, 1000); | |
return 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
<?php | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
/** | |
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE. | |
* IE10 and up does not support conditional comments in standards mode. | |
* | |
* @uses wp_style_add_data() WordPress function to add the conditional data. | |
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/ |
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_filter("the_content", "the_content_filter"); | |
function the_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join("|",array("col","shortcode2","shortcode3")); | |
// opening tag |
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
/** Break html5 cart caching */ | |
add_action('wp_enqueue_scripts', 'cartcache_enqueue_scripts', 100); | |
function cartcache_enqueue_scripts() | |
{ | |
wp_deregister_script('wc-cart-fragments'); | |
wp_enqueue_script( 'wc-cart-fragments', get_template_directory_uri() . '/cart-fragments.js', array( 'jquery', 'jquery-cookie' ), '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
// Common social media colors | |
// More at http://brandcolors.net/ | |
$dribbble-color:#ea4c89; | |
$facebook-color:#3b5998; | |
$github-color:#171515; | |
$google-color:#dd4b39; | |
$linkedin-color:#0e76a8; | |
$rss-color:#ee802f; | |
$twitter-color:#00aced; |
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
<? | |
function redux_get_variables( $name, $key = false ) { | |
global $MY_VAR_NAME; // Update to your opt_name or global_variable name | |
$options = $MY_VAR_NAME; // Update to your opt_name or global_variable name | |
$var = ""; // Set this to your preferred default value | |
if ( empty( $name ) && !empty( $options ) ) { | |
$var = $options; | |
} else { |