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
/** | |
* Open all external links in a new window | |
*/ | |
jQuery(document).ready(function($) { | |
$('a').not('[href*="mailto:"]').each(function () { | |
var isInternalLink = new RegExp('/' + window.location.host + '/'); | |
if ( ! isInternalLink.test(this.href) ) { | |
$(this).attr('target', '_blank'); | |
} | |
}); |
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 | |
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
* | |
* @link http://wordimpress.com/how-to-load-woocommerce-scripts-and-styles-only-in-shop/ | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
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 | |
/** | |
* Customize post meta. | |
* | |
* @since 3.0 | |
*/ | |
//* Customize the post meta function | |
add_filter( 'genesis_post_meta', 'child_post_meta_filter' ); |
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 | |
$featured_posts = get_posts( | |
array( | |
'posts_per_page' => 5, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'post_tag', | |
'field' => 'slug', | |
'terms' => 'featured', |
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
<!-- open external links in new window --> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
$('div.entry-content a, aside.sidebar a').each(function() { | |
var a = new RegExp('/' + window.location.host + '/'); | |
if(!a.test(this.href)) { | |
$(this).click(function(event) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
window.open(this.href, '_blank'); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/** | |
* Make WooCommerce product archive obey shop page layout settings | |
*/ | |
add_filter( 'genesis_pre_get_option_site_layout', 'vh_do_shop_layout' ); | |
function vh_do_shop_layout( $opt ) { | |
if ( is_post_type_archive('product') ) { | |
$opt = get_post_meta( wc_get_page_id('shop'), '_genesis_layout', true); | |
return $opt; | |
} | |
} |
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
// Declare WooCommerce support for your theme | |
add_theme_support( 'woocommerce' ); |
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 | |
//* Do NOT include the opening php tag shown above. Only modified code shown below. | |
function metro_homepage_widgets() { | |
// get the transient | |
$metro_homepage_content = get_transient( 'metro_homepage_content' ); | |
// check if homepage content exists | |
if ( false === $metro_homepage_content ) : |
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
.rp4wp-related-posts:after, | |
.rp4wp-related-posts ul:after { | |
clear: both; | |
content: ""; | |
display: table; | |
} | |
.rp4wp-related-posts > ul { | |
margin-left: 0; | |
padding-left: 0; |
OlderNewer