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 Taxes for Post Types | |
/*-----------------------------------------------------------------------------------*/ | |
function run_init() { | |
register_taxonomy_for_object_type('category', 'tribe_events'); | |
register_taxonomy_for_object_type('post_tag', 'tribe_events'); | |
register_taxonomy_for_object_type('tribe_events_cat', '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 | |
/** | |
* This is the template for the output of the events list widget. | |
* All the items are turned on and off through the widget admin. | |
* There is currently no default styling, which is highly needed. | |
* | |
* You can customize this view by putting a replacement file of the same name (events-list-load-widget-display.php) in the events/ directory of your theme. | |
* | |
* When the template is loaded, the following vars are set: $start, $end, $venue, $address, $city, $state, $province'], $zip, $country, $phone, $cost |
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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Modify Event List Order in Admin | |
/*-----------------------------------------------------------------------------------*/ | |
function set_custom_post_types_admin_order($wp_query) { | |
if (is_admin()) { | |
// Get the post type from the query | |
$post_type = $wp_query->query['post_type']; | |
if ( $post_type == 'tribe_events') { |
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
add_filter('tribe_get_events_title','custom_get_events_title'); | |
function custom_get_events_title( $depth=true ) { | |
global $wp_query; | |
$tribe_ecp = TribeEvents::instance(); | |
$title = __('Class Schedule', 'tribe-events-calendar'); | |
// TODO: Use the displayed dates for the title | |
/* | |
if ( tribe_is_upcoming() || isset( $_REQUEST['tribe-bar-date'] ) ) { |
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 | |
$args = array( | |
'post_type' => array(TribeEvents::POSTTYPE), // use post_type IN () to avoid old tribe queries | |
'posts_per_page' => -1, | |
'order' => 'ASC', | |
'meta_query' => array( | |
array( | |
'key' => '_EventOrganizerID', | |
'value' => get_the_ID(), |
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 | |
/*-------------------------------------------------------*/ | |
/* Default to List View When Viewing Event Categories | |
/*-------------------------------------------------------*/ | |
add_action( 'pre_get_posts', 'default_to_list_view' ); | |
function default_to_list_view( $query ) { | |
if ( is_tax(TribeEvents::TAXONOMY) && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && empty( $query->query_vars['suppress_filters'] ) ) { | |
$query->set( 'eventDisplay', 'upcoming' ); |
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
add_filter('tribe_get_organizer_link', 'my_custom_organizer_link'); | |
function my_custom_organizer_link( $postId = null, $full_link = true, $display = false ) { | |
$postId = TribeEvents::postIdHelper( $postId ); | |
$url = esc_url(tribe_get_event_meta( tribe_get_organizer_id( $postId ), '_OrganizerWebsite', true )); | |
if( $full_link && $url != '' ) { | |
$organizer_name = tribe_get_organizer($postId); | |
$link = '<a href="'.$url.'" title="'.$organizer_name.'">'.$organizer_name.'</a>'; | |
} else { | |
$link = $url; | |
} |
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
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(wp_posts.post_title, ' ', 1), ' ', -1) as memberfirst, | |
SUBSTRING_INDEX(SUBSTRING_INDEX(wp_posts.post_title, ' ', 2), ' ', -1) as memberlast, | |
wp_postmeta.meta_value | |
FROM wp_posts, wp_postmeta | |
WHERE wp_posts.ID = wp_postmeta.post_id | |
AND wp_posts.post_type = 'member' | |
AND wp_posts.post_status = 'publish' | |
AND wp_postmeta.meta_key = 'email' | |
AND wp_postmeta.meta_value != '' | |
ORDER BY wp_posts.post_date DESC |
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; | |
$current_date = date('j M Y'); | |
$end_date = date('j M Y', strtotime('1 month')); | |
echo 'Start Date:'. $current_date; | |
echo 'End Date:'. $end_date; | |
$all_events = tribe_get_events( | |
array( |
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 | |
/** | |
* This is an example of a query which gets a single random event from the | |
* 'featured' event category amongsts evetns from The Events Calendar | |
* | |
* @see http://tri.be/support/forums/topic/random-featured-event-custom-widget/ | |
*/ | |
get_header(); |