• Hi,
    I’ve installed a child-theme and created a custom post type named “product”. To change the design for this custom post type, I’ve copied the index.php of the customizr-theme to my child-theme and renamed it to single-product.php.
    But what do I have to do now, to change the design of the template?
    To ensure, that the single-product.php is choosed by the child-theme, I added some <h1>-text inside the “article”-tag (see code) to test it, but the text doesn’t appear, when I call a custom post in the browser.

    <article <?php czr_fn__f('__article_selectors') ?>>
                                            <?php do_action( '__loop' ); ?>
                                        </article>

    How can I get inside the article-tag? Unfortunately I didn’t find any tutorial, WHERE to make the changes of the code. Could you help me, please?

    Thank you very much for your reply in advance!

    Andreas

    • This topic was modified 4 years, 1 month ago by Andreas 2013.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Andreas 2013

    (@andreas-2013)

    I’ve figured out, that in customizr modern style I can’t modify directly the index.php respectively single-product.php, but have to modify the template-parts.
    But how do the template-parts depend on each other, is there a fixed hierarchy, or depends it on the wordpress-theme?

    Example: I modify the code in /parts/content/singular/post_content.php, to change the layout for the custom post type “product”. When I rename the index.php to single-product.php, this file gets the post_content.php to read the content.

    But what, if I have two custom post types “product” and “events”? I have only one file “post_content.php”! What files do I have to create in this case? It would be nice, if someone could explain it a little bit. ??

    Thread Starter Andreas 2013

    (@andreas-2013)

    Anyone, who could help me?

    Robin Labadie

    (@robin-labadie)

    Hi,

    I assume creating a child theme involves having loads of time and knowledge, and not having much support. Good luck mate ??

    Deb Shadovitz

    (@debshadovitz)

    @robin-labadie To create a child theme download the Childify plugin and use it. It takes seconds to create. You activate and customize the child theme. This way you can update Customizr without losing your customizations. It has nothing to do with creating a theme or any template or custom post type.

    Sorry @andreas-2013 but I have no idea how to do what you seek. I just wanted to set the record straight regarding Robin’s words.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Child theme: how to change template for custom post type’ is closed to new replies.