• Resolved GinaW

    (@tacaha5)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @tacaha5,

    ?Would you please refer to this topic, which is similar to this.
    ?
    ?I hope that will help. Feel free to reach out to us if you have any further queries.

    ??Kind regards,
    ?Herman ??

    Thread Starter GinaW

    (@tacaha5)

    Thanks you for that. I’m unfamiliar with hooks. If you could give me some hints one what I need to do. I want to add custom fields to the block area of my custom post type and only this custom post type which ACF fields have been created for. Please see screenshot

    Thank you for any insight. I’m still trying to learn how to do this without plugins. ??

    Hi @tacaha5,

    ?I have replied to your same query on this topic, however, I will also reply the same here as this is your own topic.

    ?For the Astra Hooks, you can refer to this Visual Guide. Or you can install our Astra Theme Visual Hooks plugin to see all hook locations in the Astra theme.

    ?I hope it will help. Feel free to reach out to us if you have any further queries.
    ?
    ?Kind regards,
    ?Herman ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Post Type and Custom Content-Single Template Part Not working’ is closed to new replies.