View gist:9135387
This file contains 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 // IN THE SPOTLIGHT QUERY | |
if( false === ( $its_query = get_transient( 'its_query' ) ) ) { | |
$pttimestamp = time() + get_option('gmt_offset') * 60*60; | |
$its_query = new WP_Query( array( | |
'post_type' => 'spotlight', | |
'posts_per_page' => 1, | |
'post__not_in' => $do_not_duplicate, | |
'meta_query' => array( | |
array( | |
'key' => '_hpc_spotlight_end_time', |
View gist:9135301
This file contains 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 // IN THE SPOTLIGHT QUERY | |
$pttimestamp = time() + get_option('gmt_offset') * 60*60; | |
$its_query = new WP_Query( array( | |
'post_type' => 'spotlight', | |
'posts_per_page' => 1, | |
'post__not_in' => $do_not_duplicate, | |
'meta_query' => array( | |
array( | |
'key' => '_hpc_spotlight_end_time', | |
'value' => $pttimestamp, |
View gist:9146805
This file contains 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 // SPECIAL FEATURE CONTENT SHORTCODE | |
function hpc_special_feature_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'type' => '', | |
'showposts' => -1, | |
'feature' => '', | |
'cat' => '', | |
'offset' => '', |
View gist:9142398
This file contains 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 | |
$header_menu_query = get_transient( 'header_menu_query' ); | |
if( $header_menu_query === false ) { | |
if ( has_nav_menu( 'header-menu' ) ) { | |
$header_menu_query = wp_nav_menu( array( | |
'menu' => '33', | |
'depth' => 3, | |
'container' => 'nav', | |
'menu_class' => 'nav nav-pills', | |
'fallback_cb' => 'wp_page_menu', |
View gist:9142610
This file contains 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 // MENU TRANSIENTS | |
function hpc_delete_menu_transients() { | |
delete_transient( 'header_menu_query' ); | |
delete_transient( 'footer_menu1_query' ); | |
delete_transient( 'footer_menu2_query' ); | |
} | |
add_action( 'wp_update_nav_menu', 'hpc_delete_menu_transients' ); |
View gist:9142340
This file contains 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 ( has_nav_menu( 'header-menu' ) ) { | |
wp_nav_menu( array( | |
'menu' => '33', | |
'depth' => 3, | |
'container' => 'nav', | |
'menu_class' => 'nav nav-pills', | |
'fallback_cb' => 'wp_page_menu', | |
'walker' => new wp_bootstrap_navwalker() | |
) ); |
View gist:9211834
This file contains 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 // SPECIAL FEATURE CONTENT SHORTCODE | |
function hpc_special_feature_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'type' => '', | |
'showposts' => -1, | |
'feature' => '', | |
'cat' => '', | |
'offset' => '', |
View gist:890e0776a71ebdab907f
This file contains 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
<a href="mailto:me@%6d%79%73i%74e.c%6f%6d">%6d%65@mys%69te.%63%6fm</a> |
View gist:c9661d20ea769bb69ff3
This file contains 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 // HIDE EMAILL ADDRESSES | |
function hide_email_from_scrapers( $atts , $content = null ) { | |
if ( ! is_email( $content ) ) { | |
return; | |
} | |
return '<a href="mailto:' . antispambot( $content, 1 ) . '">' . antispambot( $content, 1 ) . '</a>'; | |
} | |
add_shortcode( 'hide_email', 'hide_email_from_scrapers' ); |
View gist:be00f9e96d0c08d8201c
This file contains 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 | |
function hpc_spotlight_metaboxes( $meta_boxes ) { | |
$prefix = '_hpc_spotlight_'; // Prefix for all fields | |
$meta_boxes[] = array( | |
'id' => 'hpc_spotlight_meta', | |
'title' => 'In The Spotlight settings', | |
'pages' => array('spotlight'), // post type | |
'context' => 'normal', | |
'priority' => 'high', |
OlderNewer