I hereby claim:
- I am chriscree on github.
- I am chriscree (https://keybase.io/chriscree) on keybase.
- I have a public key ASBg0gh-qMpcMeIa5fx4dKQpWtD3xKxp2deSgg_J3Qe4qwo
To claim this, I am signing this object:
The functions can be modified as needed using parameters from the WordPress Codex. | |
For example, to exclude specific pages line 30 above would be changed to this instead: | |
$sitemap .= sprintf( '<ul>%s</ul>', wp_list_pages( 'title_li=&echo=0&exclude=174,180' ) ); | |
Where 174 & 180 are the page ID's of the pages to be omitted. | |
Here are the respective Codex pages for each function to find what parameters can be used: | |
wp_list_pages() | |
https://codex.wordpress.org/Function_Reference/wp_list_pages |
<?php | |
// Do not copy opening php tag above | |
add_action( 'wp_enqueue_scripts', 'wsm_custom_stylesheet', 20 ); | |
function wsm_custom_stylesheet() { | |
wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/custom.css' ); | |
} |
I hereby claim:
To claim this, I am signing this object:
<?php | |
// Do not copy opening PHP tag above | |
// Add the Shop page to Genesis breadcrumbs in WooCommerce | |
// NOTE: Assumes Genesis Connect for WooCommerce plugin is active | |
add_filter( 'genesis_archive_crumb', 'wsm_prepend_shop_link', 11, 2 ); | |
add_filter( 'genesis_single_crumb', 'wsm_prepend_shop_link', 11, 2 ); | |
function wsm_prepend_shop_link( $crumb, $args ) { | |
if ( is_singular( 'product' ) || is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) { |
<?php | |
// Don't copy the opening <?php tag above | |
// Add page title to blog page template | |
add_action( 'genesis_before', 'wsm_blog_page_title' ); | |
function wsm_blog_page_title() { | |
if ( is_page_template( 'page_blog.php' ) ) { | |
add_action( 'genesis_before_content', 'wsm_show_blog_page_title_text', 2 ); | |
} | |
} |
<?php | |
// Do not copy opening PHP tag above | |
// Remove comments from specific categories. Change out categories in array as needed. | |
add_action( 'wp_enqueue_scripts', 'wsm_remove_comments_in_category' ); | |
function wsm_remove_comments_in_category() { | |
if ( in_category( array( 'No Comments', 'Uncategorized', ) ) ) { | |
remove_action( 'genesis_after_post', 'genesis_get_comments_template' ); | |
remove_action( 'genesis_after_entry', 'genesis_get_comments_template' ); | |
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' ); |
<?php | |
// Do not copy opening PHP tag | |
// Show non sale product price in cart | |
add_filter( 'woocommerce_cart_item_price', 'wsm_show_nonsale_price', 10, 2 ); | |
function wsm_show_nonsale_price( $newprice, $product ) { | |
$_product = $product['data']; | |
$saleprice = $_product->sale_price; | |
if ( $saleprice > 0 ) { | |
$newprice = ''; |
<?php | |
// Do not copy opening php tag | |
// Force Stupid IE to NOT use compatibility mode | |
add_filter( 'wp_headers', 'wsm_keep_ie_modern' ); | |
function wsm_keep_ie_modern( $headers ) { | |
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) { | |
$headers['X-UA-Compatible'] = 'IE=edge,chrome=1'; | |
} | |
return $headers; |
jQuery(document).ready(function() { | |
jQuery.fn.cleardefault = function() { | |
return this.focus(function() { | |
if( this.value == this.defaultValue ) { | |
this.value = ""; | |
} | |
}).blur(function() { | |
if( !this.value.length ) { | |
this.value = this.defaultValue; | |
} |