How to completely customize a custom post type listing

This topic contains 8 replies, has 2 voices, and was last updated by  Shirley Dodson 7 years, 4 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #385073

    Shirley Dodson
    Expired Member
    Post count: 4

    I’m creating a website that involves very information dense pages, that I think GeoDirectory could be very useful for. The pages I’m trying to completely customize aren’t actual “listings” per-se, but because it contains so much information, I’d like visitors to be able to use the GeoDirectory Advanced Search Filters to narrow down the results. I would also very much like for visitors to be able to “Favorite” these pages in their BuddyPress profiles, the way that normal listings are. But in order for me to do this, I would have to completely overhaul the template for a few specific post types, in order to include all necessary information in a logical way.

    Are there any tutorials anywhere that could show me how to do this? I tried going through the various templates, but it seems they are based on add_actions, and I don’t understand where to find the functions that are controlling these action or how to change them.

    Any help would be greatly appreciated.
    Shirley D.

    #385074

    Shirley Dodson
    Expired Member
    Post count: 4

    Alternatively, if there is a way to add GD “favorites” to regular, non-GeoDirectory post types, I would be open to that help as well.

    #385081

    Guust
    Moderator
    Post count: 29970

    What are you trying to “overhaul”? Most customization to a CPT specific detail page can be achieved with CSS, creating and positioning of custom fields, hooks etc.
    Changing the template itself will change it for all other CPTs too.

    If you can be more specific, we can point you in the right direction.

    Thanks

    #385194

    Shirley Dodson
    Expired Member
    Post count: 4

    oh, sorry. Ok, I’ll try to be more specific.

    What I was thinking I could do was to create an if/else statement where if post-type=THIS, it would show one template, and if post-type=THAT, it could show the normal template that comes with GD. The “listings” that I want to show are pet breed profiles. I don’t really need an “author/owner” section for these pages, I just want to show the breed and it’s relevant information. But I’m not sure how to hook into the various fields in the “add new post” to display the information wherever I want to, or how to customize the side-bar, or maybe even get rid of the sidebar. I’m not sure how to do that with just CSS. I know I can hide or show various items, but how could I move custom fields to completely different parts of the template?

    I’m a very junior developer when it comes to this stuff. I can do PHP and all that, but at the lower level. These top-tier, multi-demensional PHP functions are super confusing to me.

    It may be simpler to just figure out how to get the GD “favorites” button to work for non-GD post types, as I know how to completely customize those. I’d just have to find a different search solution.

    #385205

    Guust
    Moderator
    Post count: 29970

    I don’t really need an “author/owner” section for these pages
    Hide those sections with CSS on those pages. Each CPT has its own class assigned to the body tag. See image.

    The various info displayed is controlled by the custom fields for a particular CPT, let’s say the Breed CPT.
    You can change the order by dragging up and down at GD > Breed Settings.
    You have a setting in the custom fields to add it in the sidebar, or an existing tab or create a new tab.
    https://wpgeodirectory.com/docs/core-place-settings/

    If you need us to give you some CSS or have a look at your site to assist, post your URL and WP admin details in a private reply and we will get you started.

    Thanks

    #385287

    Shirley Dodson
    Expired Member
    Post count: 4
    This reply has been marked as private.
    #385353

    Guust
    Moderator
    Post count: 29970

    1. You can add any information you like to the “Profile” tab, by entering it into the main description of the listing.

    2. To add any custom fields in a new tab you create yourself, see https://wpgeodirectory.com/docs/core-place-settings/#fieldset
    You need to create a fieldset, and then put the custom fields below that fieldset.

    Select “Details page own tab” for where you want to show the fields
    Details page own tab: Selecting this for a fieldset will create a new tab, selecting this for a custom field will show the custom field under the fieldset with the same setting above it

    Thanks

    #385354

    Guust
    Moderator
    Post count: 29970
    This reply has been marked as private.
    #385362

    Shirley Dodson
    Expired Member
    Post count: 4

    Cool! thank you very much for you answer. I don’t have time to dig into it right now, but I will as soon as I can. My days are very full over the weekend, so I won’t be checking back until around Monday. But thank you so much for your direction. I’ll be sure to give it a shot! =)

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
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount