Last active
October 10, 2016 06:18
-
-
Save kprajapatii/9a9bc61067ee5e64014b2669fd22f87b to your computer and use it in GitHub Desktop.
Display the event date in more info tab on event detail page.
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 // YOU MOST LIKELY DON'T NEED THIS LINE, SO DON'T COPY PASTE THIS LINE WITH BELOW CODE | |
/***** CODE STARTS HERE *****/ | |
// Display the event date in more info tab on event detail page. | |
function gd_event_date_in_more_info_tab() { | |
// The $post var contains all the listing info so we can add conditions. | |
global $post; | |
// Only show if the post type is "gd_event". | |
if ( !empty( $post ) && !empty( $post->post_type ) && $post->post_type == 'gd_event' ) { | |
ob_start(); | |
geodir_event_show_shedule_date(); | |
$content = ob_get_clean(); | |
if ( trim( $content ) != '' ) { | |
echo '<div class="geodir_more_info gd-detail-event-date">'; | |
echo '<style>.gd-detail-event-date .geodir-company_info{padding:0;border:0;margin:0}.gd-detail-event-date .geodir_event_schedule{padding-left:15px;}.gd-detail-event-date .geodir_event_schedule > p{padding:0;}</style>'; | |
echo $content; | |
echo '</div>'; | |
} | |
} | |
} | |
add_action( 'geodir_before_post_info_tab_content', 'gd_event_date_in_more_info_tab' ); | |
/***** CODE ENDS HERE *****/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment