override cpt archive by child theme is not working
-
Hi
I am using oceanWP theme and it’s cool.What I want to customze:
1. Make a customized view for my custom post type – product (Using CPT UI plugin)
2. Make customized Archive page for CPT – ProductHow I did and what achived:
1. Copied partials/single folder to child theme. Renamed single folder to product and edited layout.php by changing directory path for template parts [i.e get_template_part( ‘partials/product/content’ ); ]. Edited singular.php in child theme and its WORKING.2. Copied partials/entry folder to child theme. Placed entry folder in child theme – partials/product/entry and edited layout.php by changing directory path for template parts [i.e get_template_part( ‘partials/product/entry/content’ ); ]. Edited index.php by applying condition is_archive(‘product’) and is_post_type_archive(‘product’) but no success.
index.php change-
if ( is_archive( ‘product’) ) {
get_template_part( ‘partials/product/entry/layout’ );}
// All other post types.
else {
get_template_part( ‘partials/entry/layout’, get_post_type() ); }It’s still using the parent themes templates.
What am I missing? Any help?
Thanks in Advance.
- The topic ‘override cpt archive by child theme is not working’ is closed to new replies.