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 | |
/* | |
Change cancellation to set expiration date for next payment instead of cancelling immediately. | |
Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly). | |
Since 2015-09-21 and PMPro v1.8.5.6 contains code to look up next payment dates via Stripe and PayPal Express APIs. | |
*/ | |
//before cancelling, save the next_payment_timestamp to a global for later use. (Requires PMPro 1.8.5.6 or higher.) |
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('rest_prepare_post','add_featured_to_post_rest', 10, 3); | |
function add_featured_to_post_rest($data, $post, $request) { | |
$_data = $data->data; | |
$thumbnail_id = get_post_thumbnail_id($post->ID); | |
$thumbnail = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail'); | |
$thumbnailMedium = wp_get_attachment_image_src( $thumbnail_id, 'medium'); | |
$thumbnailLarge = wp_get_attachment_image_src( $thumbnail_id, 'large'); | |
$thumbnailFull = wp_get_attachment_image_src( $thumbnail_id, 'full'); |
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 | |
/** | |
* WC Ajax Product Filter by Category | |
*/ | |
if (!class_exists('WCAPF_Tag_Filter_Widget')) { | |
class WCAPF_Tag_Filter_Widget extends WP_Widget { | |
/** | |
* Register widget with WordPress. | |
*/ | |
function __construct() { |
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 | |
/* Dont Include This Comment or the opening <?php tag */ | |
/************************************* | |
* | |
* Add a body class correlating to the users | |
* memberhsip level in Paid Memberships Pro | |
* looks like - 'member-level-1' | |
* | |
**************************************/ |
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('genesis_setup', 'residence_post_meta_setup'); | |
function residence_post_meta_setup() { | |
/* Set the post type */ | |
add_action( 'pre_get_posts', 'set_residence_post_meta' ); | |
function set_residence_post_meta( $query ) { | |
$query->set( 'post_type', 'residence'); | |
$query->set( 'posts_per_page', -1 ); | |
} |
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 | |
$image = get_sub_field('background_image'); | |
if( !empty($image) ): | |
// thumbnail | |
$size = 'large'; | |
$thumb = $image['sizes'][ $size ]; | |
endif; |
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 | |
// Define ACF component markup | |
function sby_display_flexible_content() { | |
// loop through the rows of data | |
while ( have_rows('flexible_content') ) : the_row(); | |
// List Components for ACF Page Builder | |
if( get_row_layout() == 'department_intro' ) { | |
include get_stylesheet_directory() . '/lib/acf/flexible-components/department-intro.php'; | |
} elseif( get_row_layout() == 'featured_actions' ) { | |
include get_stylesheet_directory() . '/lib/acf/flexible-components/featured-actions.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
<?php | |
/* | |
Assumes a custom post type called 'staff' | |
Assumes that there is a custom taxonomy called 'department'. | |
Every department that has at least one staff member assigned to it will | |
populate a select field that is specified in Advanced Custom Fields. | |
Using that Select field we can then do a query on a custom post type | |
in this case staff and grab only the staff with our selected department. |
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
jQuery(document).ready(function ($) { | |
//On load run the function defined below | |
slickActionsScreenSize(); | |
//Run the function on window resize | |
jQuery( window ).resize( function() { | |
slickActionsScreenSize(); | |
}); |
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
/* Set foundation 6 off canvas size independant of global settings*/ | |
$offcanvas-right-size: 300px; | |
.is-open-right { | |
-webkit-transform: translateX(-$offcanvas-right-size); | |
-ms-transform: translateX(-$offcanvas-right-size); | |
transform: translateX(-$offcanvas-right-size); | |
} |