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 our special description count js | |
add_action( 'wp_enqueue_scripts', 'our_admin_scripts' ); | |
function our_admin_scripts( $hook ) { | |
global $post_type; | |
if( tribe_is_community_edit_event_page() ) { // So this only works for posts, would need to edit for events custom post type | |
$js_dir = trailingslashit( get_template_directory_uri() ) . 'js/'; | |
wp_register_script('our-admin-js', $js_dir . 'description-count.js', array('jquery'), null); | |
wp_enqueue_script('our-admin-js'); | |
} | |
} |
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_action( 'tribe_events_update_meta', 'my_function', 10, 1 ); | |
function my_function( $event_id ) { | |
//Do some logic to save the event meta information here | |
} |
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
function add_custom_title() { | |
return 'Submit a Seminar'; | |
} | |
add_action( 'tribe_ce_submit_event_page_title', 'add_custom_title'); |
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
function my_function_to_kill_event_save( $post_id ) { | |
var_dump( $post_id ); | |
exit(); | |
} | |
add_action( 'tribe_events_update_meta', 'my_function_to_kill_event_save', 10, 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
// search filter | |
function custom_search_filter($query) { | |
if ( !$query->is_admin && $query->is_search) { | |
$query->set('post_type', array('page','post') ); | |
} | |
return $query; | |
} | |
add_filter( 'pre_get_posts', 'custom_search_filter' ); |
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
<span class='tribe-events-calendar-buttons'> | |
<a class='tribe-events-button-off' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar'); ?></a> | |
<a class='tribe-events-button-on' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar'); ?></a> | |
</span> |
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
<span class='tribe-events-calendar-buttons'> | |
<a class='tribe-events-button-on' href='YOUR_URL_GOES_HERE'>Submit an Event</a> | |
<a class='tribe-events-button-on' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar'); ?></a> | |
<a class='tribe-events-button-off' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar'); ?></a> | |
</span> |
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
$( document ).on( "click", ".navigateLink", function() { | |
var anchorName = $(this).attr("ref"); | |
if(anchorName == 'top') | |
$('html,body').animate({scrollTop: '0px'},'slow'); | |
else | |
$('html,body').animate({scrollTop: $("#"+anchorName).offset().top - 60},'slow'); | |
return false; | |
}); |
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_action( 'wp_enqueue_scripts', 'sd_frontend_script_and_style' ); | |
function sd_frontend_script_and_style() { | |
wp_deregister_script( 'jquery' ); | |
$jquery_url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'; | |
wp_register_script( 'jquery', $jquery_url, array(), null, false ); | |
wp_enqueue_script('jquery'); | |
} |
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(tribe_is_community_edit_event_page()) { ?> | |
<h1 class="entry-title">NEW TITLE GOES HERE</h1> | |
<?php } else { ?> | |
<h1 class="entry-title"><?php the_title(); ?></h1> | |
<?php } ?> |