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('facetwp_facet_html', function ($output, $params) { | |
if ('dropdown' == $params['facet']['type']) { | |
$output = preg_replace("/( \([0-9]+\))/m", '', $output); | |
} | |
return $output; | |
}, 10, 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
add_filter( 'woocommerce_loop_add_to_cart_link', 'add_target_blank', 10, 2 ); | |
function add_target_blank( $link, $product ){ | |
if ( 'external' === $product->get_type() ) { | |
$link = sprintf( '<a href="%s" target="_blank" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="button product_type_%s">%s</a>', | |
esc_url( $product->add_to_cart_url() ), | |
esc_attr( $product->get_id() ), | |
esc_attr( $product->get_sku() ), |
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 | |
/* | |
* Showing Product Image on Checkout Page -- By Darshan Gada | |
*/ | |
add_action('woocommerce_before_checkout_form', 'displays_cart_products_feature_image'); | |
function displays_cart_products_feature_image() { | |
foreach ( WC()->cart->get_cart() as $cart_item ) { | |
$item = $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
<?php | |
add_filter('woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 10, 2 ); | |
function woo_change_order_received_text( $str, $order ) { | |
$new_str = 'We have emailed the purchase receipt to you. Please make sure to fill <a href="http://localhost:8888/some-form.pdf">this form</a> before attending the event'; | |
return $new_str; | |
} |
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 // Use on single product template ?> | |
<div class="related"> | |
<?php | |
// Customised: Show cross-sells on single product pages, under the attributes and short description | |
global $post; | |
$crosssells = get_post_meta( $post->ID, '_crosssell_ids',true); | |
if($crosssells) { | |
echo '<h2>Related products</h2>'; | |
echo '<ul>'; |
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
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] |
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
.m_collapse_text, .show_collapse .m_expand_text, .m_section{ | |
display: none; | |
} | |
.show_collapse .m_collapse_text { | |
display: inline; | |
} |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
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 $product; | |
$attachment_ids = $product->get_gallery_attachment_ids(); | |
foreach( $attachment_ids as $attachment_id ) | |
{ | |
//Get URL of Gallery Images - default wordpress image sizes | |
echo $Original_image_url = wp_get_attachment_url( $attachment_id ); | |
echo $full_url = wp_get_attachment_image_src( $attachment_id, 'full' )[0]; | |
echo $medium_url = wp_get_attachment_image_src( $attachment_id, 'medium' )[0]; |
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 | |
//* Remove .site-inner | |
add_filter( 'genesis_markup_site-inner', '__return_null' ); | |
add_filter( 'genesis_markup_content-sidebar-wrap_output', '__return_false' ); | |
add_filter( 'genesis_markup_content', '__return_null' ); | |
?> |
NewerOlder