Custom category template prevents other child theme templates from loading

A client wants to have some custom elements on a category page. I have taken the V IEWS/INTEGRITY/WP-PAGE.PHP, renamed it to category-news.php and placed it in the child theme. That works as expected, however we use a custom /framework/views/integrity/content.php in the child theme to add some classes so we can modify the default look. When category-news.php is added to the child theme, the default wp-page.php is loaded. Is there some additional step I need to make sure the child theme’s wp-page.php loads instead of the default in the parent theme?

Thank you.

Hi @501creative,

Thanks for reaching out.

The category page uses the same template with the blog, it’s wp-page.php. The wp-page.php is for page templates.

What you need to duplicate for category template is /x/index.php, name it to something like category-news.php, then change /views/integrity/wp-index.php to wp-category-news.php.

Then make sure x_get_view() name matches for every name that you’ll change, example, within category-news.php is x_get_view( x_get_stack(), 'wp', 'category-news' );,

Then you can also rename other templates but make sure the name calling within the codes are also changed accordingly.

Cheers!

Thanks you, that worked perfectly.

You’re welcome!
We’re glad @Rad were able to help you out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.