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:
<?php // Do not copy opening php tag | |
/** | |
* Remove WooCommerce site visibility "Live" badge from the admin bar. | |
* | |
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference. | |
*/ | |
add_action( 'admin_bar_menu', 'khp_remove_woocommerce_site_visibility_badge', 999 ); | |
function khp_remove_woocommerce_site_visibility_badge( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' ); |
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' ) ) { |
/********** Screen Reader Text starts about line 482 ************/ | |
th { | |
font-weight: 400; | |
} | |
/* ## Screen Reader Text | |
--------------------------------------------- */ | |
.screen-reader-text, |
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 | |
// Don't copy opening PHP tag above | |
// Add below code to your theme's functions.php file. | |
// Only show blog posts in search results | |
add_filter( 'pre_get_posts','wsm_post_only_search_filter' ); | |
function wsm_post_only_search_filter( $query ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', 'post' ); | |
} |
<?php | |
// Don't copy above opening PHP tag | |
// Display Custom logo based on WPML language displayed | |
add_action('wp_head','wsm_lang_logo_image_logic'); | |
function wsm_lang_logo_image_logic() { | |
if ( !defined( 'ICL_LANGUAGE_CODE' ) ) { | |
return; | |
} |
<?php | |
// Do not copy the opening <?php tag above | |
// Customize the Free! price output | |
add_filter( 'woocommerce_variable_free_price_html','wsm_custom_free_price' ); | |
add_filter( 'woocommerce_free_price_html', 'wsm_custom_free_price' ); | |
add_filter( 'woocommerce_variation_free_price_html', 'wsm_custom_free_price' ); | |
function wsm_custom_free_price( $price ) { | |
// Edit content between single quotes below to desired output | |
return 'Prepaid Inventory'; |
<?php | |
// DO not copy opening PHP tag above | |
// Enable Gravity Forms setting to hide form labels | |
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' ); |
<?php | |
// Don't copy opening PHP tag above | |
// Customize the post info function by date | |
add_filter( 'genesis_post_info', 'wsm_post_info_filter' ); | |
function wsm_post_info_filter( $post_info ) { | |
$post_date = the_date( 'Y-m-d','','', false ); | |
$date_limit = date( "Y-m-d", mktime(0,0,0,date("m")-6, date("d"), date("Y")) ); |