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 ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { | |
echo '<a href="<?php echo tribe_get_custom_field('Label For Custom Field Link'); ?>">; | |
the_post_thumbnail(); | |
echo '</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 restrict_posts_by_tax() { | |
global $typenow; | |
$post_type = 'books'; // change HERE | |
$taxonomy = 'genre'; // change HERE | |
if ($typenow == $post_type) { | |
$selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : ''; | |
$info_taxonomy = get_taxonomy($taxonomy); | |
wp_dropdown_categories(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
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page | |
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages | |
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List | |
} elseif( tribe_is_event() && is_single() ) { // Single Events | |
} elseif( tribe_is_day() ) { // Single Event Days | |
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
/** | |
* Sets events from Facebook by Tribe Events Facebook to use a predetermined category | |
* | |
* IMPORTANT: Replace "{CATEGORY ID}" on Line 35 (wp_set_object_terms...) with the ID of the category for imported events on your site. | |
* IMPORTANT: This sets a term in the default "category" taxonomy. You may prefer to set the term in the 'tribe_events_cat' taxonomy | |
* | |
* @param $post_id int id of post being inserted | |
* @param $post obj the post object | |
* | |
* @uses get_post_type() |
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 | |
// Add Tribe Event Namespace | |
add_filter( 'rss2_ns', 'events_rss2_namespace' ); | |
function events_rss2_namespace() { | |
echo 'xmlns:ev="http://purl.org/rss/2.0/modules/event/"'; | |
} | |
// Add Event Date to RSS Feeds | |
add_action('rss_item','tribe_rss_feed_add_eventdate'); |
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 tribe_enable_map_on_imported_events( $post_id ) { | |
// stop if args aren't set or we're not dealing with an event | |
if (! isset($post_id) && ! get_post_type($post_id) == 'tribe_events') { | |
return; | |
} | |
// get the field Tribe sets for event source |
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
/* | |
Intro: | |
Here are some export examples you can use to export Sabai directory data. I'm no MySQL expert and there's probably better ways to run these queries but this worked for my purposes. I hope this helps! | |
Note, this is going to export all columns and you'll need to manually go in and remove columns you don't need in Excel or Numbers or whatever spreadsheet program you have. | |
Usage: | |
This is meant to be run in phpMyAdmin. Look at your own table structure and modify as necessary for any custom fields, table prefix, and custom bundle. Custom fields are storedin their own tables and cross linked via entity_id which is the id of a listing. | |
*/ |
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 | |
/** | |
* Export WordPress post data to CSV | |
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/> | |
*/ | |
/** | |
********************************************************************* | |
* Configuration | |
********************************************************************* |
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 | |
/** | |
* update ~line 26 to include 2 argument params as such: | |
*/ | |
add_filter( 'posts_orderby', array( __CLASS__, 'events_search_orderby' ), 10, 2 ); | |
/** | |
* update static function `events_search_orderby` (replace with the following method starting at ~line 159) | |
*/ |
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
/*-----------------------------------------------------------------------------------*/ | |
/* Adds new body classes | |
/*-----------------------------------------------------------------------------------*/ | |
add_filter('body_class', 'add_browser_classes'); | |
function add_browser_classes($classes){ | |
if(is_singular()) { | |
global $post; | |
$classes[] = $post->post_name; | |
} |
OlderNewer