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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Testing document</title> | |
<style type="text/css"> | |
* { | |
font-family: Lucida Grande, Lucida Sans Unicode, Lucida Sans, DejaVu Sans, Verdana, sans-serif; | |
} | |
.wrapper { |
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 | |
/* | |
Highly customised output of product attributes | |
These functions can be used in hooks in functions/woocommerce.php or directly in templates | |
Functions: | |
1. doublee_home_room_attributes() gets the number of bedrooms, bathrooms and car spaces and outputs them as a list. | |
2. doublee_duo_home_room_attributes() gets the number of bedrooms, bathrooms and car spaces for both residences and outputs them in a condensed list. Used where doublee_home_room_attributes() is not appropriate | |
2. doublee_home_dimensions_attributes() gets the living area size, total area size, minimum block width and number of storeys and displays them in a table. | |
3. doublee_home_floorplan_image() gets and outputs the floorplan image, which is an ACF field. |
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 item descriptions to order confirmation emails | |
function doublee_add_purchase_details($order_id) { | |
echo '<h2>Item details</h2>'; | |
echo '<ul>'; | |
$order = wc_get_order($order_id); | |
foreach ($order->get_items() as $item) { | |
$product_id = $item['product_id']; | |
$product = get_post($product_id); | |
echo '<li>'; |
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 | |
// Create a WooCommerce Advanced Notifications recipient when a user registers | |
add_action( 'user_register', 'doublee_also_add_a_wc_notification_recipient', 10, 1 ); | |
function doublee_also_add_a_wc_notification_recipient( $user_id ) { | |
global $wpdb; | |
if ( isset( $_POST['username'] ) ) { // triggered by my front-end form (Ninja Form). Your field name may be different | |
$doublee_recipient_name = sanitize_text_field( stripslashes( $_POST['username'] ) ); |
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
jQuery(document).ready(function() { | |
var referrer = document.referrer; | |
var urlArray = referrer.split('/'); | |
var referrerSlug = urlArray.slice(-1)[0]; | |
jQuery("select#location > option").each(function() { | |
var label = this.value; | |
label = label.replace(/\s+/g, '-').toLowerCase(); //lower case and replace spaces with hyphens | |
label = label.replace("'", ""); //strip apostrophes |
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
/*============================================== | |
TYPE SCALES - www.type-scale.com | |
Note: the base font size and line height is set under "set the body font" in _typography.scss, | |
Paragraph margins don't change according to type scale used so they are set once in _typography.scss | |
The base font size can be changed at different breakpoints and the type will scale accordingly since it's set in ems. | |
==============================================*/ | |
@mixin use-type-scales { | |
p, | |
main 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
/*============================================== | |
TYPE SCALES - inspired by www.type-scale.com | |
Notes: | |
- The base font size and line height are set as variables, called in _typography.scss | |
- H1s are two steps up from H2s to make them stand out more | |
- Paragraph margins don't change according to type scale used so they are set once in _typography.scss | |
- The base font size can be changed at different breakpoints and the type will scale accordingly since it's set in ems. | |
- Breakpoint mixins and/or media queries can be used to change the typescale at different viewports | |
==============================================*/ |
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 | |
// Register Custom Post Type | |
function doublee_address_cpt() { | |
$labels = array( | |
'name' => 'Addresses', | |
'singular_name' => 'Address', | |
'menu_name' => 'Addresses', | |
'name_admin_bar' => 'Address', | |
'archives' => 'Address Archives', |
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 | |
// Customise the product image and gallery thumbnail to ensure they match | |
function doublee_custom_woo_images() { | |
return array( | |
'width' => 600, | |
'height' => 476, | |
'crop' => 1, | |
); | |
} | |
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'doublee_custom_woo_images' ); |
OlderNewer