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_action( 'jetpack_admin_menu', 'hide_jetpack_from_others' ); | |
function hide_jetpack_from_others() { | |
if ( ! current_user_can( 'administrator' ) ) { | |
remove_menu_page( 'jetpack' ); | |
} | |
} |
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
/** | |
* Remove product tabs | |
* | |
*/ | |
function woo_remove_product_tab($tabs) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
unset( $tabs['additional_information'] ); // Remove the additional information tab |
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_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() { | |
if (!current_user_can('administrator') && !is_admin()) { | |
show_admin_bar(false); | |
} | |
} |
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
/* | |
Changing Genesis H1 Post Titles to H2 | |
*/ | |
add_filter( 'genesis_post_title_output', 'ac_post_title_output', 15 ); | |
function ac_post_title_output( $title ) | |
{ if ( is_home() || is_archive() ) | |
$title = sprintf( '<h1 class="entry-title"><a href="' . get_permalink() . '">%s</a></h1>', apply_filters( 'genesis_post_title_text',get_the_title() ) ); | |
return $title; |
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
/** | |
* Embed Gists with a URL | |
* | |
* Usage: | |
* Paste a gist link into a blog post or page and it will be embedded eg: | |
* https://gist.github.com/2926827 | |
* | |
* If a gist has multiple files you can select one using a url in the following format: | |
* https://gist.github.com/2926827?file=embed-gist.php | |
*/ |
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_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' ); | |
function wc_minimum_order_amount() { | |
global $woocommerce; | |
$minimum = 50; | |
if ( $woocommerce->cart->get_cart_total() < $minimum ) { | |
$woocommerce->add_error( sprintf( 'You must have an order with a minimum of %s to place your order.' , $minimum ) ); | |
} | |
} |