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
<?php | |
// test with: `php valid-canadian-postal-code.php` | |
$expression = '/^([a-zA-Z]\d[a-zA-Z])\ {0,1}(\d[a-zA-Z]\d)$/'; | |
// lower, no space | |
$valid = (bool)preg_match($expression, 'k0a3m0'); | |
var_dump($valid); |
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
/** | |
* Remove thumbnail and title from specific product page | |
*/ | |
function yourthemename_wc_remove_thumbnail_title_from_product() { | |
// add your product id here | |
if ( ! is_product( '475' ) ) { | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); | |
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); | |
} | |
} |
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
<?php | |
/** | |
* Template section where the event posts are displayed. | |
*/ | |
?> | |
<aside class="events--filter"> | |
<?php echo facetwp_display( 'facet', 'audience' ); ?> | |
</aside> |
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
/** | |
* Query used to pull in post data for custom data array | |
*/ | |
function get_all_events() { | |
$args = array( | |
// Type & Status Parameters | |
'post_type' => 'event', | |
'post_status' => 'published', |
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
<?php | |
/** | |
* Customizer handler. | |
* | |
* @package jmccarthy\modularTheme\Customizer; | |
* @since 1.0.0 | |
* @author jmccarthy | |
* | |
*/ | |
namespace jmccarthy\modularTheme\Customizer; |
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
/* Good Reviews */ | |
/** Home page column layout - To be worked on */ | |
.homepage-testimonial-wrap { | |
background-color: #f1f4f0; | |
padding-top: 3em; | |
margin-top: 4em; | |
} | |
.widget_grfwp_widget_reviews h2 { | |
text-align: center; | |
} |
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
/** MailChimp for WordPress */ | |
.mc4wp-form-fields { | |
max-width: 690px; | |
margin: 0 auto; | |
} | |
.mc4wp-form-fields label { | |
margin-right: 1em; | |
margin-left: 1em; | |
color: #fff; | |
} |
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
<?php | |
add_action( 'cmb2_init', 'source_banner_metabox' ); | |
function source_banner_metabox() { | |
$prefix = '_source_demo_'; | |
$cmb_demo = new_cmb2_box( array( | |
'id' => $prefix . 'metabox', |
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
<?php | |
/** | |
* Source Genesis Child Theme | |
* | |
* @package Source | |
* @since 0.0.1 | |
* @copyright Copyright (c) 2014, Contributors to the Source project | |
* @license GPL-2.0+ | |
*/ |
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
<?php | |
// Fields set-up | |
$repeater_fields[] = $camplight_event_meta->addText('event_info',array('name'=> 'Event specific info points '),true); | |
$my_meta->addRepeaterBlock('event_info_re_',array('inline' => true, 'name' => 'Repeater Block ','fields' => $repeater_fields)); | |
// Front end template | |
$repeater_array = get_tax_meta( $not_sure_what_this_is, 'event_info_re_', true); | |
foreach($repeater_array as $arr) { |
NewerOlder