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 | |
if (have_rows('book_features', $acfw)) { | |
$features = get_field('book_features', $acfw); | |
$count = count($features); | |
echo '<div class="widget-features count-' . $count . ' cf">'; | |
while ( have_rows('book_features', $acfw) ) { the_row(); | |
$headline = get_sub_field('headline', $acfw); | |
$sub_head = get_sub_field('sub_head', $acfw); | |
$cta = get_sub_field('cta_text', $acfw); | |
$feature_link = ''; |
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
// change # to the id of your form to target a specific form | |
add_filter( 'gform_notification_#', 'route_notification', 1, 2 ); | |
function route_notification($notification, $form , $entry) { | |
global $post; | |
// the $post here is the post where the Form is displayed | |
$email_to = get_post_meta($post->ID, 'email', true); | |
if ($email_to){ | |
$notification['to'] .= ',' . $email_to; | |
} | |
return $notification; |
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
// GET YOUTUBE ID FROM URL | |
function getYouTubeIdFromURL($url) { | |
$pattern = '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i'; | |
preg_match($pattern, $url, $matches); | |
return isset($matches[1]) ? $matches[1] : false; | |
} |
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
// helper function for twitter card stuff | |
// GET YOUTUBE ID FROM URL | |
function getYouTubeIdFromURL($url) { | |
$pattern = '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i'; | |
preg_match($pattern, $url, $matches); | |
return isset($matches[1]) ? $matches[1] : false; | |
} |
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
if (function_exists('get_field')) { | |
$fields = get_fields(); | |
if( $fields ) { | |
foreach( $fields as $field_name => $value ) { | |
$field = get_field_object($field_name, false, array('load_value' => false)); | |
if($value) { |
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
/**** | |
USE JETPACK IN DEVELOPMENT MODE ON LOCALHOST | |
*****/ | |
if ( $_SERVER['SERVER_NAME'] == 'gladdestthing.dev' ) { // replace gladdestthing.dev with local url | |
add_filter( 'jetpack_development_mode', '__return_true' ); | |
} |
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
//[nbsp] shortcode | |
add_shortcode( 'nbsp', 'nbsp_shortcode' ); | |
function nbsp_shortcode( $atts, $content = null ) { | |
$a = shortcode_atts( array( | |
'num' => 1, | |
), $atts ); | |
$content = str_repeat(' ', $a['num']); | |
return $content; | |
} |
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('sidebar-menu','fwp_simplesidenav'); | |
function fwp_simplesidenav( $atts, $content = null) { | |
global $post; | |
$current_page = $post->ID; | |
extract( shortcode_atts( array( | |
'exclude' => '', | |
'exclude_children_of' => '', | |
'exclude_tree' => '', | |
'children_of' => $current_page, |
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 | |
// See if "posts page" is set in Settings > Reading, aka is_home() | |
// If it is, display this page's title before the posts | |
$page_for_posts = get_option( 'page_for_posts' ); | |
if ($page_for_posts) { ?> | |
<header class="page-header"> | |
<h1 class="page-title" itemprop="headline"> | |
<?php echo get_queried_object()->post_title; ?> | |
</h1> | |
</header> <?php // end article header ?> |
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
{ | |
"key": "group_5a0cb501d0249", | |
"title": "Location & Hours", | |
"fields": [ | |
{ | |
"key": "field_5a0cb50f1fae4", | |
"label": "Header Hours & Location info", | |
"name": "header_hours", | |
"type": "wysiwyg", | |
"instructions": "", |