Archived topic
Custom Post Type with custom layout
30 replies · Started by tenchystryder on December 19, 2019
Hi Tom and gang
This is for a brand new site. (no content yet)
I would like to know if there is a way to create a unique layout for certain posts, but I also need to create the fields that build that post.
Basically, lets say you have a sports person profile, I would like to create a new post, and on that page within admin also have the fields there to fill in like name, Age, Height, profile picture etc, then when you submit the post, the layout is unique to player profile. (bit like profile page on some forums etc)
If this is possible and once I get to grips with it, I could then use the same process to create lets say a sports ground review, etc etc.
I've looked at loads of plugins etc, but not found anything will do the job.
Hi there,
To do this, you would have to create custom post type templates: https://developer.wordpress.org/themes/template-files-section/custom-post-type-template-files/
In those, you would set up your HTML structure and add your meta fields where needed.
Let me know if you need more info :)
Hi Tom
I'll take a look over the weekend thank you :-)
Just had a quick look at this. If i took this route would it not be within the theme and thus removed when GP updates?
You'd want to use a child theme to avoid that: https://docs.generatepress.com/article/using-child-theme/
I'm not good at child themes really :-(
Was looking around this morning at my other site and am thinking I might be able to get away with using a combo of WooCommerce and a table plugin.
I would just have to remove all the price, stock and other stuff not needed and just use WC for it's ability to split all the categories, tags and attributes and of course it's layout
........... And that won't work. I'll try and read up on the child themes :-(
Depending on the data you're adding to the template, you might be able to use our Hook Elements instead of a custom page template.
Player profiles mainly Tom
age, height, goals scored, assists etc
Looking at child theme set ups now and i'm completely baffled :-)
.... Also may work with posts, not just pages. I could use either and/or
Right
This is way over the top but this page gives an example of the type of thing i need/want.
I know it's never going to be that good, but trying to get an easy to use system and layout either in a post or page to achieve anything a quarter of this would be nothing short of a miracle. there will be loads of entries on the site hence an easy way to input it via a post/template type of thing.
Wish I was really good at this. My ambitions massively outweigh my ability
Something like that would require quite a lot of custom coding, unfortunately.
You might be able to find a plugin that offers that kind of layout - seems like something a lot of people would find useful.
There is "one plugin" would probably be perfect but when I tried it I got a warning it's not compatible with GP and I got a whole load of errors came up.

However, I have just installed and tried this and it seems to be half working, albeit not perfect.
Ahhh, There you go
Warning: Invalid argument supplied for foreach() in /homepages/27/d767341814/htdocs/INFO_SUFC/wp-content/plugins/wp-club-manager/includes/admin/class-wpcm-admin-post-types.php on line 829
Warning: join(): Invalid arguments passed in /homepages/27/d767341814/htdocs/INFO_SUFC/wp-content/plugins/wp-club-manager/includes/admin/class-wpcm-admin-post-types.php on line 832
Just found this Tom. How difficult is it to get GP working with this plugin as the plugin is quite good actually.