eic2010
Forum Replies Created
-
AuthorPosts
-
Thanks for your quick response. That is great. However if I wanted to have a link going to , say ‘June Events’, how would I do this?
Hello again
I think I’ve got it to work! Well it is showing where I want it but I just want to check that what I’ve done won’t harm anything 🙂
I have used the plugin code snippet and created the following new snippet:
function gd_show_event_schedule_as_tab( $template ) {
if ( has_filter( ‘geodir_detail_page_sidebar_content’, ‘geodir_event_detail_page_sitebar_content’ ) ) {
remove_filter( ‘geodir_detail_page_sidebar_content’, ‘geodir_event_detail_page_sitebar_content’, 2 );
add_filter( ‘geodir_detail_page_tab_list_extend’, ‘gd_detail_page_tab_event_schedule’, 3, 1 );
add_action( ‘geodir_after_tab_content’, ‘gd_detail_page_tab_content_event_schedule’, 3, 1 );
}return $template;
}
add_filter( ‘template_include’, ‘gd_show_event_schedule_as_tab’, 3 );
function gd_detail_page_tab_event_schedule( $tab_array ) {
if ( ‘gd_event’ == get_post_type() ) {
$tab_array[‘event_schedule’] = array(
‘heading_text’ => __( ‘Event Date(s)’, ‘geodirevents’ ),
‘is_active_tab’ => false,
‘is_display’ => apply_filters( ‘geodir_detail_page_tab_is_display’, true, ‘event_schedule’ ),
‘tab_content’ => ”
);
}return $tab_array ;
}
function gd_detail_page_tab_content_event_schedule( $tab ) {
if ( $tab == ‘event_schedule’ ) {
geodir_event_show_schedule_date();
}
}Then in the functions file of my child theme I have put the following:
// this is the snippet that adds the filter, calling the function below.
add_filter(‘geodir_detail_page_tab_list_extend’, ‘geodir_detail_page_tab_list_extend’) ;// this is the function that does the re-ordering that we call with the add filter snippet above.
function geodir_detail_page_tab_list_extend($tab_array)
{// here you can modify the array and re-arrange tabs as you wish, you can create a completely new array too.
// this is the post profile tab, by default is the 1st
if(isset($tab_array[‘post_profile’])){
$new_tab_array[‘post_profile’] = $tab_array[‘post_profile’]; // set in new array
unset($tab_array[‘post_profile’]);//unset in old one
}// this is the post info tab (optional for custom fields), by default, if available, is the 2nd.
if(isset($tab_array[‘post_info’])){
$new_tab_array[‘post_info’] = $tab_array[‘post_info’];// set in new array
unset($tab_array[‘post_info’]);//unset in old one
}// this is the events schedule tab, by default is the 3rd
if(isset($tab_array[‘event_schedule’])){
$new_tab_array[‘event_schedule’] = $tab_array[‘event_schedule’];// set in new array
unset($tab_array[‘event_schedule’]);//unset in old one
}// this is the images tab, by default is the 4th
if(isset($tab_array[‘post_images’])){
$new_tab_array[‘post_images’] = $tab_array[‘post_images’];// set in new array
unset($tab_array[‘post_images’]);//unset in old one}
// this is the video tab, appears only if there are videos and by default is the 5th
if(isset($tab_array[‘post_video’])){
$new_tab_array[‘post_video’] = $tab_array[‘post_video’];// set in new array
unset($tab_array[‘post_video’]);//unset in old one
}// this is the speacial offer tab, appears only if there are special offers and by default is the 6th
if(isset($tab_array[‘special_offers’])){
$new_tab_array[‘special_offers’] = $tab_array[‘special_offers’];// set in new array
unset($tab_array[‘special_offers’]);//unset in old one
}// this is the map tab, by default is the 7th
if(isset($tab_array[‘post_map’])){
$new_tab_array[‘post_map’] = $tab_array[‘post_map’];// set in new array
unset($tab_array[‘post_map’]);//unset in old one
}// this is the review tab, by default is the 8th
if(isset($tab_array[‘reviews’])){
$new_tab_array[‘reviews’] = $tab_array[‘reviews’];// set in new array
unset($tab_array[‘reviews’]);//unset in old one
}// this is the related listing tab, it is optional and by default is the 9th
if(isset($tab_array[‘related_listing’])){
$new_tab_array[‘related_listing’] = $tab_array[‘related_listing’];// set in new array
unset($tab_array[‘related_listing’]);//unset in old one
}// now we set any remaining tabs that have not been assigned an order
foreach($tab_array as $key=>$tab){
$new_tab_array[$key]=$tab;
}return $new_tab_array ;
}
?>This has now moved the event dates to above the photos and below the info, which is what I am after.
Does this look right? Is there anything I should change/remove/add?
Thanks in advance for your help!
Hi again
Many thanks for your help so far. I really need to move the time and dates on the events but whatever I try I am unsuccessful! So far I have moved the dates from the sidebar to the main listing (I use list view) but its appearing at the bottom of the page. Unfortunately I cannot wait for v2 and my knowledge of coding is not particularly advance. I have tried amending the functions file but nothing seems to change, I don’t know what I’m doing wrong! I looked at https://wpgeodirectory.com/re-order-tabs-in-a-listing-detail-page/ but I cant see any reference to moving event dates and times. I’ve tried codes mentioned in other forums such as https://wpgeodirectory.com/support/topic/re-order-tabs-in-events-detail-page/ but again nothing seems to work. I’d really appreciate any help anyone can give!
Thanks in advanceHi
I have not tested V2 yet. The site is live so I cant run the risk of anything breaking. Are all the add-ons compatible yet?Any update to my last post? I’d really appreciate the help
Thank you!Hi
Thanks for that but I cannot seem to get it to move. Everything I try seems to crash it. The above code I used first time works in that it moves it from the sidebar but it appears at the bottom of the page. Is there a simple amendment needed to the above code I have used which would move the event schedule up to between Profile and More Info?Hi
I have tried:function gd_detail_page_tab_event_schedule( $tab_array ) {
if ( ‘gd_event’ == get_post_type() ) {$tab_array_new = array();
foreach($tab_array as $key=>$tab){
$tab_array_new[$key] = $tab;
if($key==’post_profile’){
$tab_array_new[‘event_schedule’] = array(
‘heading_text’ => __( ‘Date n Time’, ‘geodirevents’ ),
‘is_active_tab’ => false,
‘is_display’ => apply_filters( ‘geodir_detail_page_tab_is_display’, true, ‘event_schedule’ ),
‘tab_content’ => ”
);
}}
return $tab_array_new;
}
return $tab_array ;
}but it has done nothing?
Thanks! Just what I was after!
Thanks Stiofan! That worked, really appreciate your help, thank you again!
Thanks for getting back to me. I’ve tried
add_action(‘geodir_after_tab_content’,’_my_tab_content_after’);
function _my_tab_content_after($tab){
if($tab== ‘post_map’){
echo do_shortcode(‘[social_warfare]’);
}
}
but my site still breaks and shows a 500 error?
I’d like it under the ‘get directions’ of the map.This reply has been marked as private.Hi
Apologies for keep returning to this! I’m nearly there I think with this problem but my themes developer has said I need to wrap text inside h3 of the widget title with span tag like this: <h3 class=”widget-title”><span>Upcoming Events</span></h3>
But I cannot work out how to do this? Can you advise?
Thanks in advance!Thanks, appreciate your help
Hi
I tried
add_action(‘geodir_after_tab_content’,’_my_tab_content_after’);
function _my_tab_content_after($tab){
if($tab== ‘post_map’){
echo ‘[social_warfare]’;
}
}
but it just broke my site. Is there something obvious I’m obviously missing?!!Thanks, is there a way it could be done with code snippets?
-
AuthorPosts