Custom Post Type and Custom Content-Single Template Part Not working
-
I’ve created a custom post type called ‘Contact_List’. In my child theme I’ve added the single.php template file and renamed it single-contact_list.php. That works. Now I want to be able to edit what’s in the content box and show custom fields associated with the custom post type. When I copy the template-parts/content-single.php to my child theme. I believe I am to name the template part content-single-contact_list.php.
However when I do that, my custom field, or any custom html does not show up. If I leave the file name content-single.php, the fields show up as well as custom html, but it obviously is showing on all posts. How can I get this to just appear on my custom post type?
I’m sorry I do not have a site for you to look at because it is behind a firewall.
- The topic ‘Custom Post Type and Custom Content-Single Template Part Not working’ is closed to new replies.