Title: Error when using custom endpoints / templates
Last modified: March 18, 2022

---

# Error when using custom endpoints / templates

 *  [streamworksaudio](https://wordpress.org/support/users/streamworksaudio/)
 * (@streamworksaudio)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/error-when-using-custom-endpoints-templates/)
 * Hi,
 * I have created a couple custom endpoints and whenever the endpoint is accessed
   and Kadence theme template is used, I get the following error:
 * `Warning: First parameter must either be an object or the name of an existing
   class in /path/wp-content/themes/kadence/template-parts/content/archive_hero.
   php on line`
 * I am using the template_include filter to load my own templates for these endpoints,
   but in some cases I would like to return a default template, such as the 404 
   template when needed. But I also get the error above when doing so. The error
   is also present if I disable my template_include filter and Kadence tries to 
   load one of it’s own templates.
 * Not sure if this something that can be addressed – my alternate testing theme(
   Elementor Hello) does not have this issue as their templates are very basic.
 * Any ideas? Or is that just the way Kadence is when it comes to templates?
 * Cheers.

The topic ‘Error when using custom endpoints / templates’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/kadence/1.5.0/screenshot.png)
 * Kadence
 * [Support Threads](https://wordpress.org/support/theme/kadence/)
 * [Active Topics](https://wordpress.org/support/theme/kadence/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/kadence/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/kadence/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [streamworksaudio](https://wordpress.org/support/users/streamworksaudio/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/error-when-using-custom-endpoints-templates/)
 * Status: not resolved