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
  • Author
    Posts
  • #448494

    eic2010
    Full Member
    Post count: 209

    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!

    #448502

    Alex Rollin
    Moderator
    Post count: 27815
    #448517

    eic2010
    Full Member
    Post count: 209

    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?

    #448966

    eic2010
    Full Member
    Post count: 209

    Any update to my last post? I’d really appreciate the help
    Thank you!

    #448975

    Alex Rollin
    Moderator
    Post count: 27815

    The 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?

    #449154

    eic2010
    Full Member
    Post count: 209

    Hi
    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?

    #449156

    Alex Rollin
    Moderator
    Post count: 27815

    No, and we recommend testing on a test site.

    #449175

    eic2010
    Full Member
    Post count: 209

    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 advance

    #449216

    Alex Rollin
    Moderator
    Post count: 27815

    Hello 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.

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket