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, |
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', |
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() | |
) ); |
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', |
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' ); |
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' => '', |
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' => '', |
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' ); |
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> |
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