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( 'genesis_before_comments' , 'webendev_comment_count' ); | |
/** | |
* Add comment count and remove standard comment title | |
* | |
*/ | |
function webendev_comment_count () { | |
add_filter( 'genesis_title_comments', '_return_null' ); | |
if ( is_single() ) { | |
if ( have_comments() ) { | |
echo '<h3>'; |
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( 'woocommerce_checkout_fields', 'webendev_woocommerce_checkout_fields' ); | |
/** | |
* Change Order Notes Placeholder Text - WooCommerce | |
* | |
*/ | |
function webendev_woocommerce_checkout_fields( $fields ) { | |
$fields['order']['order_comments']['placeholder'] = 'Your custom placeholder'; | |
return $fields; | |
} |
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( 'gform_user_registered','we_autologin_gfregistration', 10, 4 ); | |
/** | |
* Auto login to site after GF User Registration Form Submittal | |
* | |
*/ | |
function we_autologin_gfregistration( $user_id, $config, $entry, $password ) { | |
wp_set_auth_cookie( $user_id, 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
add_action( 'after_setup_theme', 'wpss_theme_setup' ); | |
/** | |
* Create custom image sizes | |
*/ | |
function wpss_theme_setup() { | |
add_image_size( 'pdfv_thumbnail', 115, 150, true ); | |
add_image_size( 'activity-thumb', 100, 120, true ); | |
add_image_size( 'featured', 590, 250, TRUE ); | |
add_image_size( 'home-slider-crop', 615, 245, TRUE ); //540x? | |
add_image_size( 'home-slider', 615, 245, FALSE ); //540x? |
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
//* Unregister primary/secondary navigation menus | |
remove_theme_support( 'genesis-menus' ); | |
//* Add New Menu Navigation with dynamic child category walker class | |
add_action( 'genesis_after_header', 'webendev_subcat_navigation', 15 ); | |
function webendev_subcat_navigation() { | |
echo '<nav class="nav-primary">'; | |
wp_nav_menu( | |
array( | |
'container_class' => 'wrap', |
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( 'woocommerce_payment_complete_order_status', 'webendev_virtual_order_payment_complete_order_status', 10, 2 ); | |
/** | |
* WooCommerce - Set Virtual Order Status to Complete After Payment | |
* http://www.skyverge.com/blog/how-to-set-woocommerce-virtual-order-status-to-complete-after-payment/ | |
* | |
*/ | |
function webendev_virtual_order_payment_complete_order_status( $order_status, $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( 'processing' == $order_status && |
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
Reduce database queries (http://www.catswhocode.com/blog/speeding-up-your-wordpress-blog-7-effective-solutions) | |
It is important to reduce unecessary queries to your database as each query take a few milliseconds to execute. First, you might want to know how many queries your blog execute in order to display a page. To do so, paste the code below in your functions.php file. Once done, just have a look to your site footer to know how many queries has been executed and how many time it took to completely load the page. | |
add_action( 'wp_footer', 'tcb_note_server_side_page_speed' ); | |
function tcb_note_server_side_page_speed() { | |
date_default_timezone_set( get_option( 'timezone_string' ) ); | |
$content = '[ ' . date( 'Y-m-d H:i:s T' ) . ' ] '; | |
$content .= 'Page created in '; | |
$content .= timer_stop( $display = 0, $precision = 2 ); | |
$content .= ' seconds from '; |
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( 'gform_pre_render_20', 'webendev_add_readonly_script' ); | |
/** | |
* Make Gravity Form Field Read Only (first page of multi-page or a single page) | |
* | |
*/ | |
function webendev_add_readonly_script($form){ | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ |
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 shireman_books_header_loop( $args ) { | |
global $post; | |
$defaults = array( | |
'orderby' => 'rand', | |
'post_type' => 'we_published-book', | |
'posts_per_page' => 9, | |
'post_status' => 'publish', | |
'no_found_rows' => true, // counts posts, remove if pagination required | |
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...) | |
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required |
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( 'woocommerce_order_number', 'webendev_woocommerce_order_number', 1, 2 ); | |
/** | |
* Add Prefix to WooCommerce Order Number | |
* | |
*/ | |
function webendev_woocommerce_order_number( $oldnumber, $order ) { | |
return 'WE' . $order->id; | |
} |
NewerOlder