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
// Pull content from another page | |
function show_post($path) { | |
$post = get_page_by_path($path); | |
$content = apply_filters('the_content', $post->post_content); | |
echo $content; | |
} | |
// To use | |
<?php show_post('about'); ?> |
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 responsive container to embed videos | |
function forty_responsive_video( $html ) { | |
//add http protocol | |
$html = str_replace('<iframe src="//', '<iframe src="http://', $html); | |
return '<div class="flex-video">' . $html . '</div>'; | |
} | |
add_filter( 'embed_oembed_html', 'forty_responsive_video', 10, 3 ); | |
add_filter( 'video_embed_html', 'forty_responsive_video' ); |
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
// TINYMCE Options | |
function my_mce4_options( $init ) { | |
$custom_colours = ' | |
"db1e34", "Color Name", "222c64", "Color Name Two" | |
'; | |
$init['textcolor_map'] = '['.$custom_colours.']'; | |
$init['textcolor_rows'] = 6; | |
return $init; | |
} | |
add_filter('tiny_mce_before_init', 'my_mce4_options'); |
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 custom ACF option pages | |
if(function_exists('acf_add_options_page')) { | |
acf_add_options_page(); | |
acf_add_options_sub_page('Site Options'); | |
} |
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 custom selectors to Gravity Forms | |
add_action("gform_field_css_class", "custom_class", 10, 3); | |
function custom_class($classes, $field, $form){ | |
$classes .= " " . $field["type"]; | |
return $classes; | |
} |
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
module.exports = function() { | |
function sendInformation(){ | |
var months = [ | |
'01', | |
'02', | |
'03', | |
'04', | |
'05', | |
'06', |
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
// Open all external links in new window. | |
$('a').each( function (i, link) { | |
var $link = $(link), | |
href = $link.attr('href'); | |
if (!!href) { | |
href = href.toString(); | |
if (-1 === href.indexOf(window.location.host) || -1 !== href.indexOf('.pdf')) | |
$link.attr('target', '_blank'); | |
} |