This file contains hidden or 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( 'gform_field_validation', 'check_mailchimp_status', 10, 4 ); | |
function check_mailchimp_status ( $result, $value, $form, $field ) { | |
$target_form = 10; | |
if ( ($field->formId == $target_form) && ($field->id == 1) ) { | |
if ( $field->type == 'email' && $result['is_valid'] && class_exists( 'GF_MailChimp_API' ) ) { | |
fb_log( 'gform_field_validation: running.' ); | |
$api_key = gf_mailchimp()->get_plugin_setting( 'apiKey' ); |
This file contains hidden or 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
{"0":{"title":"Download Form","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"email","id":1,"label":"Email","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":5,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"Your email","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","emailConfirmEnabled":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""}],"version":"2.4.14","id":5,"nextFieldId":3,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled" |
This file contains hidden or 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
function add_cats_tags_to_pages() { | |
// Add tag metabox to page | |
register_taxonomy_for_object_type('post_tag', 'page'); | |
// Add category metabox to page | |
register_taxonomy_for_object_type('category', 'page'); | |
} | |
// Add to the admin_init hook of your theme functions.php file | |
add_action( 'init', 'add_cats_tags_to_pages' ); |
This file contains hidden or 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_shortcode('get-image-grid','get_images_by_category'); | |
function get_images_by_category( $atts ) { | |
$retHtml = ''; | |
$attribs = shortcode_atts( array( | |
'cat_slug' => "", | |
'link_to_file' => true, | |
'mime_type' => "image", | |
'class' => "cell small-6 medium-3", |
This file contains hidden or 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 the ability to display the content block in a reqular post using a shortcode | |
function custom_post_image_shortcode( $atts ) { | |
$params = shortcode_atts( array( | |
'id' => '', | |
'slug' => '', | |
'class' => 'content_block_image', | |
'suppress_content_filters' => 'no' | |
), $atts ); |
This file contains hidden or 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="home-video-wrap" > | |
<video id="home-video" autoplay mute preload loop data-origin-x="0" data-origin-y="0" poster="<?php echo( get_stylesheet_directory_uri() ); ?>/dist/assets/images/home-hero-3000.jpg"> | |
<source src="<?php echo( get_stylesheet_directory_uri() ); ?>/dist/assets/images/TrevHomeHero.mp4" type="video/mp4"> | |
Your browser does not support the video tag. | |
</video> | |
</div> |
This file contains hidden or 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 menu order to the Posts edit screen | |
add_action( 'init', 'ingeni_add_posts_menuorder' ); | |
function ingeni_add_posts_menuorder() | |
{ | |
add_post_type_support( 'post', 'page-attributes' ); | |
} | |
// Reorder the loop sorting fro the the 'projects' category | |
function ingeni_change_category_order( $query ) { | |
if ( $query->is_category('projects') && $query->is_main_query() ) { |
This file contains hidden or 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
// | |
// WooCommerce - replace read more buttons for out of stock items | |
// | |
if (!function_exists('woocommerce_template_loop_add_to_cart')) { | |
function woocommerce_template_loop_add_to_cart() { | |
global $product; | |
if ( !$product->is_in_stock() ) { | |
echo '<a href="'.get_permalink().'" rel="nofollow" class="outofstock button">Out of Stock</a>'; | |
} else { | |
woocommerce_get_template('loop/add-to-cart.php'); |
This file contains hidden or 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( 'gform_phone_formats', 'au_phone_format' ); | |
function au_phone_format( $phone_formats ) { | |
$phone_formats['au'] = array( | |
'label' => 'Australia', | |
'mask' => '99 9999 9999', | |
'regex' => '/^\({0,1}((0|\+61)(2|4|3|7|8)){0,1}\){0,1}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{1}(\ |-){0,1}[0-9]{3}$/', | |
'instruction' => 'Australian phone numbers.', | |
); | |
return $phone_formats; |
This file contains hidden or 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
// | |
// | |
// Custom breakpoint for larger tablets | |
// | |
// | |
$breakpoints: ( | |
small: 0, | |
medium: 640px, | |
tablet: 860px, |