Archived topic
CPT UI and Advanced Custom Fields
3 replies · Started by Peter on January 20, 2018
Hi,
I am trying to display a custom post type I have created using the two above mentioned plugins.
But I am struggling a lot.
What post-template should I use in order to display the custom post type?
Can any of you please help me with a coding example for displaying single custom post types?
My biggest problems are which template to use as a foundation for a new CPT temnplate and the proper coding notation for GP.
I am using a child theme of GP.
I have been reading a lot (the whole day) both on the Net's many sites and pages about this and on GP's support forums.
Thank you very much in advance for any help.
cheers
Peter
Hi Peter,
If you're using a child theme, you can follow these naming structures to make templates specifically for your custom post type: https://developer.wordpress.org/themes/basics/template-hierarchy/#custom-post-types
Depending on what the CPTs are displaying, you could also create shortcodes, or use a plugin like WP Show Posts to display the content.
Hi Tom,
Thank you for your reply with links and suggestions.
I did in fact manage to create a post template file for displaying single CPTs in the way I want it to be displayed - so that's great!
However, I am in no way convinced that I am following best practices and that's why I asked for a more specific coding example of displaying both single CPTs and archives of CPTs - the best practice way... :-)
Onwards and forwards, right?
cheers
Peter
It's hard to give an example when it comes to stuff like that, as the structure of the code changes completely depending on the content being added to it.
Glad you got it working! :)