Media
Find Image Aspect Ratio
Height / Width * 1, 2, 3, 4… until the result is a whole number.
Ex. 560 / 720 * 9 = 7 (Aspect Ratio is 9:7)
Branding
Copyright Footer
Copyright ©
All Rights Reserved | Website by ArcFires
General HTML
WordPress Tooltips Plugin Shortcode
[tooltips keyword="
content="tooltip"]
WordPress
WooCommerce
Disable WooCommerce Image Zoom
add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 );
function remove_pgz_theme_support() {
remove_theme_support( 'wc-product-gallery-zoom' );
}
Add to Cart Link
[website.com]/cart/?add-to-cart=[ID]?variation_id=[SKU]
"View Cart" Button Spacing (After Add to Cart)
a.added_to_cart.wc-forward {
padding: 10px;
}
Customize WooCommerce Order Confirmation Page
add_filter('woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 10, 2 );
function woo_change_order_received_text( $str, $order ) {
$new_str = $str . ' You will receive the receipt via email shortly.;
return $new_str;
}
Expand Width of Cart Coupon Field
input#coupon_code {
width: 55%;
}
Advanced Custom Fields
Format Number Fields as Phone Numbers
// Return ACF number fields with commas
add_filter('acf/format_value/name=party_leader_phone_number', 'formatPhoneNumber', 20, 3);
function formatPhoneNumber($value, $post_id, $field) {
$value = preg_replace('/[^0-9]/','',$value);
if(strlen($value) > 10) {
$countryCode = substr($value, 0, strlen($value)-10);
$areaCode = substr($value, -10, 3);
$nextThree = substr($value, -7, 3);
$lastFour = substr($value, -4, 4);
$value = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;
}
else if(strlen($value) == 10) {
$areaCode = substr($value, 0, 3);
$nextThree = substr($value, 3, 3);
$lastFour = substr($value, 6, 4);
$value = '('.$areaCode.') '.$nextThree.'-'.$lastFour;
}
else if(strlen($value) == 7) {
$nextThree = substr($value, 0, 3);
$lastFour = substr($value, 3, 4);
$value = $nextThree.'-'.$lastFour;
}
return $value;
}
Edit wp-config.php File
Fix "Password Strength Unknown"
# Add to wp-config.php after the < php line
$_SERVER['HTTPS'] = true;