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 TicketTagged: Custom Post Types, customize, favorites, templates
-
AuthorPosts
-
June 28, 2017 at 9:40 pm #385073
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.June 28, 2017 at 9:44 pm #385074Alternatively, if there is a way to add GD “favorites” to regular, non-GeoDirectory post types, I would be open to that help as well.
June 28, 2017 at 11:07 pm #385081What 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
June 29, 2017 at 8:05 pm #385194oh, 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.
June 29, 2017 at 11:55 pm #385205I 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
June 30, 2017 at 2:40 pm #385287This reply has been marked as private.June 30, 2017 at 11:01 pm #3853531. 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 itThanks
June 30, 2017 at 11:15 pm #385354This reply has been marked as private.June 30, 2017 at 11:54 pm #385362Cool! 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! =)
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket