View custom.php
<?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' ) ) { |
View gist:11b7c9fa634ec1c5206be73c143fecbd
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'); | |
} |
View filter.thumbnail.functions.php
/** | |
* | |
* 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; |
View gist:81b6142126dc9ed4498e2d988bfa1231
<?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' ) ); |
View smooth-scroll.jquery.js
// 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; | |
} | |
} |
View functions.php
<?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/ |
View gist:050d3c0d05ddc996aa7789046f877a84
<?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 |
View cart-cache-breaker.php
/** 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 ); | |
} |
View colors.scss
// 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; |
View redux_get_variables.php
<? | |
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 { |