New tab, details page

This topic contains 5 replies, has 4 voices, and was last updated by  anders 5 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #461374

    anders
    Full Member
    Post count: 121

    Hi,

    I tried this code for adding a new tab with listings shortcode on a site with GeoDirectory V2 but it did not have any effect
    https://wpgeodirectory.com/add-a-new-tab-in-the-listing-detail-page/
    Is it valid for v2 also?

    I know that I can add tabs through GeoDirectory settings and it works really well!
    But I figure it would be more flexible for me adding it programmatically through a child theme, hopefully I can add some conditionals like only showing the tab when there are posts to display… ?

    Thanks!

    #461396

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    V1 snippets will generally not work with V2.

    We will take a look at the subject of programmatically adding tabs and the developers will create an example as soon as they can, but their focus is on making the GeoDirectory V2 final release.

    I have flagged your topic for the developers and they will post an update here as soon as they can.

    #461473

    Kiran
    Moderator
    Post count: 7069

    Hello,

    In v2 it is easy to add custom tab on detail page.

    Go CPT > Settings > Tabs > Custom Fields > Select “Shortcode” > Set shortcode > Save.

    Kiran

    #461475

    anders
    Full Member
    Post count: 121

    Thank you Alex and Kiran!

    Yes, I tried that first and I agree it´s very easy and works really well too.
    The main reason I was looking for an alternative way is that I was hoping I could set a condition to only display the tab when the listing -shortcode contains posts to show.

    Thanks!

    #461968

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The tab should not output if empty.

    I have added a new filter for filtering the tabs settings which will be in the next release “geodir_tab_settings” this is an array of stdClass settings.

    Stiofan

    #462221

    anders
    Full Member
    Post count: 121

    Thank you Stiofan, that sounds great!

    Perhaps you could publish a small example on how to best use it?

    Thanks again!

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

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

Open Support Ticket