Moving Event date from sidebar
This topic contains 8 replies, has 2 voices, and was last updated by Alex Rollin 5 years, 6 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
October 2, 2018 at 3:27 pm #448494
Hi
I am trying to move date on events from sidebar to a new tab. I use list view. I have used the following code: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’, 10, 1 );
add_action( ‘geodir_after_tab_content’, ‘gd_detail_page_tab_content_event_schedule’, 10, 1 );
}return $template;
}
add_filter( ‘template_include’, ‘gd_show_event_schedule_as_tab’, 10 );
function gd_detail_page_tab_event_schedule( $tab_array ) {
if ( ‘gd_event’ == get_post_type() ) {
$tab_array[‘event_schedule’] = array(
‘heading_text’ => __( ‘Event Schedule’, ‘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();
}
}This has worked but I would like it to go between Profile and More Info. What do I need to change to do this?
Thanks in advance!
October 2, 2018 at 3:49 pm #448502Please see: https://wpgeodirectory.com/re-order-tabs-in-a-listing-detail-page/
Let us know how it goes
October 2, 2018 at 4:32 pm #448517Hi
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?October 6, 2018 at 4:08 pm #448966Any update to my last post? I’d really appreciate the help
Thank you!October 6, 2018 at 8:24 pm #448975The re-ordering is separate from what you are doing above and requires the snippet linked here:
https://wpgeodirectory.com/re-order-tabs-in-a-listing-detail-page/This is much easier in V2, have you already tested it?
October 9, 2018 at 2:05 pm #449154Hi
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?October 9, 2018 at 2:26 pm #449156No, and we recommend testing on a test site.
October 9, 2018 at 6:13 pm #449175Hi 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 advanceOctober 10, 2018 at 8:04 am #449216Hello again,
You will need to use the snippet on this page:
https://wpgeodirectory.com/re-order-tabs-in-a-listing-detail-page/
To make your new tab first, then place ‘event_schedule’ first in the list.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket