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_action( 'init', 'tribe_fix_homepage', 11, 1 ); | |
function tribe_fix_homepage() { | |
remove_action( 'parse_request', array( 'TribeEventsQuery', 'parse_request' ), 50 ); | |
add_action( 'parse_query', 'tribe_fix_homepage_query', 51 ); | |
} | |
function tribe_fix_homepage_query( $query ) { | |
if ( ! $query->is_main_query() ) { | |
$query->is_home = 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
/* ----------------------------------------- | |
* Put excerpt meta-box before editor | |
* ----------------------------------------- */ | |
add_action( 'add_meta_boxes', 'my_add_excerpt_meta_box' ); | |
function my_add_excerpt_meta_box( $post_type ) { | |
if ( in_array( $post_type, array( 'tribe_events' ) ) ) { | |
add_meta_box( | |
'contact_details_meta', __( 'Excerpt' ), 'post_excerpt_meta_box', $post_type, 'test', // change to something other then normal, advanced or side | |
'high' |
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
//* From http://wordpress.stackexchange.com/questions/174412/setting-featured-image-based-on-related-post | |
/** Define a default post thumbnail Genesis */ | |
function default_event_image_fallback($output, $args) { | |
global $post; | |
if( $output || $args['size'] == 'full' && get_post_type() == 'tribe-events' ) | |
return $output; | |
$post_id = tribe_get_organizer_id(); | |
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size ); |
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 | |
// Add a new interval of a week | |
// See http://codex.wordpress.org/Plugin_API/Filter_Reference/cron_schedules | |
add_filter( 'cron_schedules', 'myprefix_add_weekly_cron_schedule' ); | |
function myprefix_add_weekly_cron_schedule( $schedules ) { | |
$schedules['weekly'] = array( | |
'interval' => 604800, // 1 week in seconds | |
'display' => __( 'Once Weekly' ), | |
); |
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
//* Featured Videos for Single Entries | |
add_action( 'genesis_before_entry', 'featured_video_plus_single_page_override', 9 ); | |
function featured_video_plus_single_page_override( $output ){ | |
$image_args = array( | |
'size' => 'large', | |
'attr' => array( | |
'class' => 'alignnone featured-image', | |
), | |
); |
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 "See All Videos" Link to Featured Videos | |
add_action( 'wp_head', 'target_gs_ftd' ); | |
function target_gs_ftd() { | |
if ( is_active_widget( true, 'featured-content-3', 'featured-content', true ) ) { | |
add_filter( 'gsfc_after_loop', 'featured_content_3' ); | |
function featured_content_3( $instance ) { | |
if ( 3 != $instance['custom_field'] ) { | |
return; | |
} | |
echo '<div class="more-wrapper"><a href="http://www.su.app/shenandoah-today/videos/">See All Videos</a></div>'; |
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
//* Featured Events Secondary Featured Image | |
if (class_exists('MultiPostThumbnails')) { | |
new MultiPostThumbnails(array( | |
'label' => 'Featured Image 2', | |
'id' => 'featured-image-2', | |
'post_type' => 'su_feat_events' | |
) ); | |
} |
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
//* Program Faculty | |
$faculty = get_field('faculty_listing'); | |
if( have_rows('faculty_listing') ) : | |
echo '<section class="row" id="faculty"><div class="wrap"><h4>Faculty</h4><div class="faculty">'; | |
while( have_rows('faculty_listing') ): the_row(); | |
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
//* Program Locations | |
$program_locations = get_field( 'program_locations' ); | |
if ( $program_locations ) { | |
echo '<section class="location-widget widget widget_text"><div class="wrap widget-wrap">'; | |
echo '<h4 class="widget-title widgettitle">Program Locations</h4>'; | |
$field = get_field_object('program_locations'); |