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_add_cart_item_data', 'ps_empty_cart', 10, 3); | |
function ps_empty_cart( $cart_item_data, $product_id, $variation_id ) { | |
global $woocommerce; | |
$woocommerce->cart->empty_cart(); | |
// Do nothing with the data and return | |
return $cart_item_data; | |
} |
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
<? | |
/* | |
Wordpress + WooCommerce | |
Add product directly to cart and take user to Checkout page | |
Instructions: | |
- add all php code within comment block below to active Wordpress theme file: functions.php | |
- use URL structure: http://your-site.com/?add-to-cart=37 WHERE 37 is the ID of your WooCommerce 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' , 'custom_override_checkout_fields' ); | |
function custom_override_checkout_fields( $fields ) { | |
unset($fields['billing']['billing_first_name']); | |
unset($fields['billing']['billing_last_name']); | |
unset($fields['billing']['billing_company']); | |
unset($fields['billing']['billing_address_1']); | |
unset($fields['billing']['billing_address_2']); |
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 | |
global $user_identity; | |
//$user_submissions = get_posts(); | |
if ($user = wp_get_current_user()) { | |
$author = array('id' => $user->ID); | |
} else { | |
$commenter = wp_get_current_commenter(); | |
$author = array( | |
'author' => $commenter['comment_author'], |
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( 'bp_blogs_record_post_post_types', 'inspired_record_more_types' ); | |
function inspired_record_more_types( $types ) { | |
$types[] = 'projects'; | |
$types[] = 'sfwd-courses'; | |
$types[] = 'uig_image'; | |
return $types; | |
} | |
add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3); | |
function record_cpt_activity_action( $activity_action, $post, $post_permalink ) { |
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
// initially fire isotope layout | |
var $grid = $('.grid').isotope({ | |
itemSelector: '.grid-item', | |
transitionDuration: 0, | |
masonry: { | |
columnWidth: 100 | |
} | |
}); | |
// runs isotope reload on facetwp change |
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
facetwp_is_main_query | |
facetwp_ajax_response | |
facetwp_load_assets | |
facetwp_load_css | |
facetwp_query_args | |
facetwp_facet_html | |
facetwp_render_output | |
facetwp_pre_filtered_post_ids | |
facetwp_filtered_post_ids | |
facetwp_template_html |
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', 'addBootstrapToCheckoutFields' ); | |
function addBootstrapToCheckoutFields($fields) { | |
foreach ($fields as &$fieldset) { | |
foreach ($fieldset as &$field) { | |
// if you want to add the form-group class around the label and the input | |
$field['class'][] = 'form-group'; | |
// add form-control to the actual input | |
$field['input_class'][] = 'form-control'; |
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
# --------------------------------------- | |
# Main Module | |
# --------------------------------------- | |
user nginx; | |
# This number should be, at maximum, the number of CPU cores on your system. | |
worker_processes 2; | |
pid /var/run/nginx.pid; | |
# Only log critical errors |
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
<div id="myCarousel" class="carousel slide"> | |
<ol class="carousel-indicators"> | |
<li data-target="#myCarousel" data-slide-to="0" class="active"></li> | |
<li data-target="#myCarousel" data-slide-to="1"></li> | |
<li data-target="#myCarousel" data-slide-to="2"></li> | |
<li data-target="#myCarousel" data-slide-to="3"></li> | |
<li data-target="#myCarousel" data-slide-to="4"></li> | |
</ol> | |
<div class="carousel-inner"> | |
<?php query_posts('post_type=features&showposts=1'); ?> |
OlderNewer