Custom Listing Details template

This topic contains 2 replies, has 3 voices, and was last updated by  Guust 9 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #48849

    samediamba
    Free User
    Post count: 2

    This is a great plugin,

    I would like to do the following
    1. Create a completely custom single listings template for my website. I have two category of items: hotels and accomodation facilities, and the general business directory. I would like to categorize them as such, and have the single template for the hotels appear differently from that of the general business directory. I’ve attached home.pdf to show the difference

    BTW, normally when editing single cpt templates in WP, we normally use single-{name-of-cpt}.php to achieve this. How do we do this then with GD? And how do we achieve this for different categories?

    2. I would also like to customize the single listing sidebar further. I have no problem with the share buttons and the analytics functionality that comes coded by default- I would just like to push them down further and instead have my preferred sidebar fuctionality at the top.

    3. I would like to include Advanced Custom Fields (ACF) fields in the single listings template. I believe that if we address 1 and 2 sufficiently, 3 will not be a problem.

    #48912

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    1) GeoDirectory uses it’s own templating system so the default wp templating system is overridden. single-{name-of-cpt}.php won’t work.

    We use one template for each CPT and that is geodirectory/geodirectory-templates/listing-detail.php (https://wpgeodirectory.com/docs/codex/geodirectory_templates/listing-detail-php/)

    Here you find an example of how to modify the detail page template without touching templates : https://wpgeodirectory.com/support/topic/modifying-the-layout/#post-46117

    You can use cnoditional tags to change things between custom post type. Example:

    
    
    
    if(isset($post->post_type) && $post->post_type=='gd_place'){//stuff for gd_place}
    elseif(isset($post->post_type) && $post->post_type=='gd_mycpt'){//stuff for gd_mycpt}
    else {}

    2) The listings sidebar is managed through this template:geodirectory/geodirectory_templates/detail-sidebar.php (https://wpgeodirectory.com/docs/codex/geodirectory_templates/detail-sidebar-php/)

    The procedure is the same as point 1

    3) I don’t think it is possible, we provide our system for custom fields and I doubt ACF is able to write custom fields in GD custom DB tables.

    Thanks

    #48915

    Guust
    Moderator
    Post count: 29970

    1. Creating a different layout for different listings is only possible for different custom post types, not different categories I think. But I have flagged your question for Paolo as well, because I am not sure how you create different content on the detail page depending on the type of listing.
    See also: https://wpgeodirectory.com/docs/places-categories-and-listings/

    2. This should get you started to move the widget area of the detail page above the GD sidebar:
    https://wpgeodirectory.com/docs/customizing-geodirectory-templates/
    You can also achieve some changes at GD > design > detail tab

    3. Not sure what ACF is but I guess it is some other plugin. But you might want to review these links too, they show how to add GD custom fields and how to manipulate where they are shown on the pages:
    https://wpgeodirectory.com/docs/core-place-settings/#custom
    https://wpgeodirectory.com/remove-tabs/

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount