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 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
<?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
//* 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
/* ----------------------------------------- | |
* 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
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
<?php if ( !(tribe_event_featured_image())) { echo '<div><a href="' . tribe_get_event_link() . '"><img src="[image url goes here]" alt="' . the_title() . '" /></a></div>';} else { echo tribe_event_featured_image(null,'thumbnail'); } ?> |
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
//* Genesis Featured Sandbox - Switch to Blog 1 | |
add_action ( 'gsfc_before_post_content','add_event_info', 10); | |
function add_event_info(){ | |
global $post; | |
if (tribe_get_start_date() !== tribe_get_end_date() ) { | |
echo tribe_get_start_date( null, false, 'l\, F jS' ) . ' from <meta itemprop="startDate" content="' . tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ) . '"/>' . tribe_get_start_date(null, false, 'g:i a') . 'to <meta itemprop="endDate" content="' . tribe_get_end_date( null, false, 'Y-m-d-h:i:s' ) . '"/>' . tribe_get_end_date(null, false, 'g:i a'); | |
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
//* Genesis Featured Sandbox - Switch to Blog 1 | |
add_action ( 'gsfc_before_loop','add_category_links', 10); | |
function add_category_links(){ | |
global $blog_id; | |
if( $blog_id == '1' ) { | |
echo '<div id="nav" class="filter-news"><div class="wrap"><div class="hover-drop"><a class="filter-click suicon-angle-circled-down" href="javascript:void(0)">Filter News</a>'; | |
wp_nav_menu( |