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( 'wc_add_to_cart_message', 'dfh_change_cart_message', 10, 2 ); | |
function dfh_change_cart_message( $cart_message, $product_id ) { | |
if(strpos($cart_message, "Continue Shopping") !== false) | |
{ | |
$cart_message = str_replace("Continue Shopping","Shop More",$cart_message); | |
} | |
return$cart_message; | |
} |
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 /** | |
* @Title: WooCommerce Edit Checkout Billing Address fields | |
*/ | |
add_filter( 'woocommerce_checkout_fields' , 'dfh_woo_mod_woo_billing_address_fields' ); | |
function dfh_woo_mod_woo_billing_address_fields( $fields ) { | |
// Remove Billing Company Field | |
unset($fields['billing']['billing_company']); |
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_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' ); |
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 Continue Shopping Button on Cart Page | |
* Add to theme functions.php file or Code Snippets plugin | |
*/ | |
add_action( 'woocommerce_before_cart_table', 'woo_add_continue_shopping_button_to_cart' ); | |
function woo_add_continue_shopping_button_to_cart() { |
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
/ Redirect all traffic to non-www. For example yoursite.com | |
if (isset($_SERVER['PANTHEON_ENVIRONMENT']) && | |
($_SERVER['PANTHEON_ENVIRONMENT'] === 'live') && | |
// Check if Drupal or WordPress is running via command line | |
(php_sapi_name() != "cli")) { | |
if ($_SERVER['HTTP_HOST'] == 'www.youwebsite.com') { | |
header('HTTP/1.0 301 Moved Permanently'); | |
header('Location: https://yourwebsite.com'. $_SERVER['REQUEST_URI']); | |
exit(); | |
} |
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
<script> | |
jQuery(function(){ | |
jQuery("a").each(function(){ | |
if (jQuery(this).attr("href") == window.location.pathname){ | |
jQuery(this).addClass("youarehere"); | |
} | |
}); | |
}); | |
</script> |
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; | |
if ( ! $user->uid) { | |
$dest = drupal_get_destination(); | |
drupal_goto('user/login', array('query' => $dest)); | |
}?> |
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 | |
function my_force_ssl() { | |
return true; | |
} | |
add_filter('force_ssl', 'my_force_ssl', 10, 3); | |
================================================================== | |
// Remove WooCommerce Updater |
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="my-folio-of-works" class="prev_img svwp"> | |
<ul> | |
<ul> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
$args = array( | |
'post_parent' => 222, | |
'post_type' => 'attachment' | |
); |
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 class="indent"> | |
<?php include_once('homepage-gallery.php') | |
$id = '222'; | |
$existing_attachments = attachments_get_attachments($id); | |
if( is_array($existing_attachments) && !empty($existing_attachments) ) { | |
$attachment_index = 0; | |
echo '<ul>'; | |
foreach ($existing_attachments as $attachment) { | |
$attachment_index++; | |
?> |