• 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 – Product

    How 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    following the post will help you with this.
    https://wordpress.org/support/topic/how-to-design-archive-for-custom-post-type/

    Thread Starter explorerwp

    (@explorerwp)

    @abhikr781 Thanks for responding.

    I applied all the suggestions from that thread (which you shared).

    It helped me. But I didn’t get what I want.

    For clarification –
    1. Can I override CPT archive page by child theme?

    2. If yes, i guess problem with either the conditional tag of index.php or folder structure as i kept entry folder into product (cpt) folder.

    3. If no, should I design a archive-product.php by following wp convenient?

    4. Another thing is I want the design as it is in oceanwp theme.

    Thanks.

    • This reply was modified 2 years, 8 months ago by explorerwp.

    Hello,

    In the OceanWP theme, you can’t create a category-slug.php file. It will not work.
    I’ll suggest you follow the thread and steps to get the desired result.
    To call the template, try to edit the index.php file to get the correct template for custom CPT.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘override cpt archive by child theme is not working’ is closed to new replies.