Knowledge Base
Themer’s Guide
Customizing Template Files
Coupon Creator Pro comes with a template system to enable you to move templates to your child theme where you can edit them and not lose the changes when updating Pro. Pro only feature.
1. Create a directory in your child theme (parent themes work too)
Go to your child theme directory, located at wp-content/themes/your-theme/.
Create the following directory:
- To modify Coupon Creator Pro
/cctor-coupons/
2. Locate the files in Pro that you would like to edit
Find the template files in the plugin directory:
- Coupon Creator Pro template files
/wp-content/plugins/coupon-creator-pro/src/views/
Once you have a template you would like to edit, move it to your theme.
This:
/coupon-creator-pro/src/views/category/category.php
Becomes this:
/child-theme/cctor-coupons/category/category.php
If you are not sure where a template should be moved in your theme, the comments at the top of each template will tell your were to override it:
Template override @ [your-theme]/cctor-coupons/category.php
Views and Templates
Coupon Creator Pro
Pro’s Coupon Loop Templates
- default/default-wrap.php – Wrapper for the category template
- default/content.php – Main content template with the title, filter bar, header and footer nav,, and the loop
- default/nav.php – Contains the next and previous links
- default/loop.php – Contains the loop of coupons with the template for single coupons
- default/single-coupon.php – Contains a single coupon output
Category Templates
- category/category.php – Wrapper for the category template
- category/content.php – Main content template with the title, header and footer nav, and the loop
- category/nav.php – Contains the next and previous links
- category/loop.php – Contains the loop of coupons with the template for single coupons
- category/single-coupon.php – Contains a single coupon output
Filter Bar Template
- filter-bar/filter-bar.php – Filter Bar wrapper and form
Print View
- print/single-coupon.php – Print view coupon template
Custom Category Templates
Along with the standard templates to modify you can expand the templates and create custom templates per coupon category. To do that use the slug as a new directory inside the category directory:
Custom Category Templates
- category/slug/loop.php – Wrapper for the category template
- category/slug/single-events – Wrapper for the category template
For example if you have a Shopping category you could modify the loop.php template by adding this to your theme:
/child-theme/cctor-coupons/category/shopping/loop.php
That will then modify only the loop.php file for the Shopping Category all other templates will continue to use the standard category templates. This feature currently only works with the coupon category archives and not with the couponloop shortcode output.