• Resolved edtaaffe

    (@edtaaffe)


    I have created a child theme because I need to make small code changes and must keep auto-updates on.
    I read the instructions on wordpress, but its confusing:

    It says; if the parent them has woocommerce/templates/amazingtemplate.php
    the child them should have woocommerce/amazingtemplate.php
    In other words leave out “templates”. I m guessing the get function just assumes there wil be a templates folder.
    So what do I do when parent the structure contains:
    woocommerce/template-parts/amazingtemplate.php ( this is the case in my theme)
    or
    woocommerce/templates/template-parts/amazingtemplate.php

    Anyone who’s done development as I used to do knows the feeling when the bug is not responding to tests. The platform is very complicated, the web and cache and cache plugins and so much to look at at if you’re over 25 :-).

    Any advice would be great.
    There are dozens of tutorials in Google SERP and as usual, all copied form one another, all omitting the key question.
    Thanks in advance.

    • This topic was modified 3 years, 5 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You only remove the /templates/ part if you are overriding a woocommerce template. A template in /template-parts/ is not a woocommerce template, so the remove /templates/ bit does not apply.

    WP only looks in the theme folder for base templates. Template parts included from base templates are brought in with get_template_part() with a passed path relative to the theme folder. Use the actual path, don’t add or remove parts.

    Thread Starter edtaaffe

    (@edtaaffe)

    You are a stellar guy. I should have worked this out because I was an asp programmer for years and its very similar.
    Now I’ll find my errors and get to work.
    Much obliged.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Making a child theme when the template file structure is complex’ is closed to new replies.