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($) { | |
$('a[href^="#"]:not(a[href="#"])').unbind('touchend click').on('touchend click', function(e) { | |
var target = $(this.hash); | |
if (target.length) { | |
e.preventDefault(); | |
e.stopImmediatePropagation(); | |
var headerHeight = 50; // put your offset here in px |
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
jQuery(document).ready(function($){ | |
// The X/Pro "Added to cart" overlay | |
var notification = $('.x-cart-notification'); | |
$(".single_add_to_cart_button").on('click', function(e) { | |
e.preventDefault(); | |
var quantity = $('input[name="quantity"]').val(), |
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
// Displaying Excerpt in Recent Posts | |
// ============================================================================= | |
function x_shortcode_recent_posts_v2( $atts ) { | |
extract( shortcode_atts( array( | |
'id' => '', | |
'class' => '', | |
'style' => '', | |
'type' => 'post', | |
'count' => '', |
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 cart count and value to Cart Element text in a Pro header | |
// ============================================================================= | |
add_filter('woocommerce_add_to_cart_fragments', 'mb_cart_count_fragments', 10, 1); | |
function mb_cart_count_fragments($fragments) { | |
$count = WC()->cart->get_cart_contents_count(); | |
$value = ($count == 0) ? '$0.00' : WC()->cart->get_cart_total(); | |
$cart = ($count == 0) ? 'Cart' : 'Items: ' . $count; |
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 visual indicator to pages and posts built in Pro | |
// ============================================================================= | |
function bourne_identity_columns( $columns ) { | |
$myCustomColumns = array( | |
'probuilder' => __( 'Builder' ) | |
); | |
$columns = array_merge( $columns, $myCustomColumns ); |
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', 'miro_load_script', 99 ); | |
function miro_load_script() { | |
wp_deregister_script( 'vendor-ilightbox' ); | |
wp_register_script( 'vendor-ilightbox', get_stylesheet_directory_uri() . '/new-ilightbox.js', array( 'jquery' ), '2.2.4', 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
<?php | |
// Add cart count and value to Cart Element text in a Pro header | |
// ============================================================================= | |
add_filter('woocommerce_add_to_cart_fragments', 'mb_cart_count_fragments', 10, 1); | |
function mb_cart_count_fragments($fragments) { | |
$count = WC()->cart->get_cart_contents_count(); | |
$fragments['.cartdropdown .x-anchor-text-primary'] = '<span class="x-anchor-text-primary">' . $count . '</span>'; | |
return $fragments; | |
} |
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(){ var config = cornerstoneApp.lookup('service:store').peekRecord('option','cornerstone_font_config');config.set('value.customItems', [ { family: 'MikesFont', stack: 'MikesFont, sans-serif', weights: [ '300', '500' ]}]);config.save()})(); |
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
/** | |
* Get theme colors from Pro and turn them into classes and CSS variables | |
* Author: Michael Bourne | |
*/ | |
$themecolors = get_option('cornerstone_color_items'); | |
if($themecolors) { | |
$css = '<style type="text/css" id="themecolours">'; | |
$colors = json_decode( stripslashes( $themecolors ), 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_filter('cs_match_header_assignment', 'custom_search_header'); | |
function custom_search_header($match) { | |
$user = wp_get_current_user(); | |
if (in_array( 'author', (array) $user->roles )) { | |
$match = 1234; // the post ID for your header | |
} | |
return $match; | |
} |