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, | |
'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 | |
// LOGOUT LINK IN MENU | |
function diww_menu_logout_link( $nav, $args ) { | |
$logoutlink = '<li><a href="'.wp_logout_url().'">Logout</a></li>'; | |
if( $args->theme_location == 'main_menu' && is_user_logged_in() ) { | |
return $nav.$logoutlink ; | |
} else { | |
return $nav; |
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 // load parent theme CSS | |
function load_parent_theme_css() { | |
wp_enqueue_style( 'parent-theme', get_template_directory_uri() . '/style.css' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'load_parent_theme_css' ); |
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
©2014 |
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 echo date( 'Y' ); ?> |
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 | |
global $post; | |
$tmp_post = $post; | |
$args = array( 'post_type' => 'events', 'numberposts' => $soupnumber, 'no_paging' => '1', 'post_status' => $posttype, 'order' => 'ASC', 'orderby' => $postorder, 'ignore_sticky_posts' => '1', 'category' => $soup_cat); | |
$myposts = get_posts( $args ); | |
foreach( $myposts as $post ) : setup_postdata($post); ?> | |
<li><?php the_title(); ?></li> | |
<?php endforeach; ?> | |
<?php $post = $tmp_post; ?> |
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 // REGISTER TESTIMONIAL CPT | |
if ( ! function_exists('twpb_testimonial_cpt') ) { | |
function twpb_testimonial_cpt() { | |
$labels = array( | |
'name' => _x( 'Testimonials', 'Post Type General Name', 'twpb' ), | |
'singular_name' => _x( 'Testimonial', 'Post Type Singular Name', 'twpb' ), | |
'menu_name' => __( 'Testimonial', 'twpb' ), |
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 force_https () { | |
if ( !is_ssl() ) { | |
wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301 ); | |
exit(); | |
} | |
} | |
add_action ( 'template_redirect', 'force_https', 1 ); |
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 /* Disable specified plugins in development environment */ | |
if ( defined( 'WP_ENV' ) && WP_ENV == 'dev' ) { | |
$plugins = array( | |
'iwp-client/init.php', | |
'google-analytics-for-wordpress/googleanalytics.php', | |
); | |
require_once(ABSPATH . 'wp-admin/includes/plugin.php'); | |
deactivate_plugins($plugins); |
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 | |
// Enable the plugin only when Jetpack and Sharedaddy are enabled | |
function shortlinks_for_sharing_buttons() { | |
if ( | |
class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'get_active_modules' ) && in_array( 'sharedaddy', Jetpack::get_active_modules() ) | |
) { | |
add_filter( 'sharing_permalink', 'get_shortlink_for_post' ); | |
} |