This file contains hidden or 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 fixBlockLink( elements ) { | |
elements.forEach(function (element) { | |
var elLink = element.querySelector('p > a').href; | |
var wrapper = document.createElement('a'); | |
var elementWrapped = element.querySelector('.fw-col-inner'); | |
wrapper.href = elLink; | |
wrapElement(elementWrapped, wrapper) | |
}); |
This file contains hidden or 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 hexToRgb($hex, $alpha = false) { | |
$hex = str_replace('#', '', $hex); | |
$length = strlen($hex); | |
$rgb['r'] = hexdec($length == 6 ? substr($hex, 0, 2) : ($length == 3 ? str_repeat(substr($hex, 0, 1), 2) : 0)); | |
$rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0)); | |
$rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0)); | |
if ($alpha) { | |
$rgb['a'] = $alpha; | |
} | |
return $rgb; |
This file contains hidden or 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 filter_cars_by_taxonomies( $post_type, $which ) { | |
// Apply this only on a specific post type | |
if ( 'page' !== $post_type ) | |
return; | |
// A list of taxonomy slugs to filter by | |
$taxonomies = array( 'page_categ'); | |
foreach ( $taxonomies as $taxonomy_slug ) { |
This file contains hidden or 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 woocommerce_header_add_to_cart_fragment($fragments) { | |
global $woocommerce; | |
ob_start(); | |
?> | |
<a class="cart-customlocation" | |
href="<?php echo $woocommerce->cart->get_cart_url(); ?>" | |
title="<?php _e('View your shopping cart', 'woothemes'); ?>"> | |
<?php echo WC()->cart->get_cart_total(); ?> |
This file contains hidden or 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 remove_default_post_type() { | |
remove_menu_page('edit.php'); | |
} | |
add_action('admin_menu','remove_default_post_type'); |
This file contains hidden or 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_filter('style_loader_tag', 'remove_type_atribute', 10, 2); | |
add_filter('script_loader_tag', 'remove_type_atribute', 10, 2); | |
function remove_type_atribute($tag ) { | |
return preg_replace( "/type=['\"]text\/(javascript|css)['\"]/", '', $tag ); | |
} |
This file contains hidden or 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 jh_admin_scripts() { | |
if(is_admin()){ | |
wp_enqueue_script('admin-script', get_bloginfo('template_url').'/js/admin.js', array('jquery')); | |
} | |
} | |
add_action('admin_enqueue_scripts', 'jh_admin_scripts'); |
This file contains hidden or 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_filter('site_transient_update_plugins', 'remove_update_notification'); | |
function remove_update_notification($value) { | |
unset($value->response[ plugin_basename(__FILE__) ]); | |
return $value; | |
} |
NewerOlder