Using Custom Class Model Files in a Child Theme
-
This theme is quite different from other themes I’ve used in regard to its template system. In addition, I am using the Modern model and much of the documentation on your website seems to apply to the Classic model.
I used the czr_post_list_loop_item_template filter (from loop.php) to change the post lists item template for a custom post type (online_exhibit). I called my custom template online_exhibit_list.php and based it on post_list_plain.php. However, my custom template did not render the same style-wise as the original and I realized it was because post_list_plain.php has a corresponding class model file (class-model-post_list_plain.php) while my new template does not.
So I made my own class model file (class-model-online_exhibit_list.php) by copying class-model-post_list_plain.php and renaming its class. I placed this in the proper location within my child theme directory and that allowed my new custom template to render properly style-wise.
However, I am wondering if this is a proper way to go about doing this. With other themes, I would likely just make a file called archive-online_exhibit.php based on the theme’s archive.php file. But this theme works differently and I’m trying to stay with the same structure and use the filters provided for my customization.
The topic ‘Using Custom Class Model Files in a Child Theme’ is closed to new replies.
