• I am using the latest version of understrap with the understrap child theme.

    I have created a custom post type called event. I then wanted to override the single post template, so created a new custom post template called single–event.php. However, this is not overriding the single.php template. When I use exactly the same code in one of the WordPress themes it works fine, so I am thinking it must be an issue somewhere with understrap. I would be very grateful for any assistance in finding what the issue may be.

    Many thanks

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

    What does your get_template_part() call look like? It’s probably not able to match the slug.

    The Query Monitory plugin is pretty handy for getting more information on which templates are being called (and what’s not being loaded).

    Ben

    Thread Starter Mango123

    (@mango123)

    Thanks so much @berksted for getting back to me so quickly. I installed Query Monitor and realised I had added a hook for choosing a specific template based on the post id that I had forgotten about. This was preventing the correct temaplate from being used.

    Thanks again!

    @mango123

    Your welcome!

    Glad to hear that worked.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Template Override for Single Custom Post Type Not Working’ is closed to new replies.