View WooCommerce Hide Product Fields on Virtual product
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 | |
add_filter( 'woocommerce_checkout_fields' , 'woo_remove_billing_checkout_fields' ); | |
/** | |
* Remove unwanted checkout fields | |
* | |
* @return $fields array | |
*/ | |
function woo_remove_billing_checkout_fields( $fields ) { |
View post-sort-order-by-meta.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
// change sort order of posts based on meta | |
function change_order_for_post_archive( $query ) { | |
//only show future events and events in the last 24hours | |
if ( $query->is_main_query() && is_post_type_archive('attorney') ) { | |
$query->set( 'meta_key', 'ecpt_position' ); | |
$query->set( 'orderby', 'meta_value' ); | |
$query->set( 'order', 'ASC' ); | |
} |
View Change Woo Add to Cart Text
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
/* CHANGE ADD TO CART BUTTON TEXT ON A PER PRODUCT BASIS | |
**********************************************************/ | |
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text'); | |
function woo_custom_cart_button_text() { | |
if ( is_singular('product') ) { | |
global $post; |
View page-support-questions.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( 'genesis_entry_content', 'user_post_list' ); | |
function user_post_list() { | |
if ( ! is_user_logged_in() ) : | |
echo 'You must be logged-in to view your submitted questions and answers.'; | |
// wp_login_form(); | |
else : |
View Custom ACF Query for Staff Picks
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
// Custom Loop Calling Staff Picks from Author Currently being viewed | |
$picks = get_posts(array( | |
'posts_per_page' => 3, | |
'post_type' => 'staffpicks', | |
'meta_query' => array( | |
array( | |
'key' => 'author', // name of custom field | |
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234" | |
'compare' => 'LIKE' | |
) |
View Custom Meta Query with Post Object in Advanced Custom 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 Staff Picks below Staff Member | |
add_action( 'genesis_entry_content', 'os_add_recent_staff_picks' ); | |
function os_add_recent_staff_picks() { | |
// Custom Loop Calling Staff Picks from Author Currently being viewed | |
$staffname = get_the_title(); | |
// New Query for staff picks matching author name | |
$pick_args = array( | |
'posts_per_page' => 3, |
View string query in staged donation for nationbuilder
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
// Added by CraigGrella.com for pinning amount to string query | |
// Used for creating buttons in emails with links for specific dollar amounts | |
function getQueryVariable(variable) | |
{ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
if(pair[0] == variable){return pair[1];} | |
} |