• I’m using the twentytwelve theme. I’ve set up a child theme which consists of the basic “functions.php” and “style.css” files.

    The twentytwelve theme puts meta data about each post (e.g., “This entry was posted in Uncategorized on 9/22/15 by …) in the post footer. I would like to move this meta data to the top of the post, under the post title. The data is generated with a function called twentytwelve_entry_meta.

    It looks like content.php determines where this meta data will appear.
    The twentytwelve theme has it located in the footer class:

    <footer class="entry-meta">
       <?php twentytwelve_entry_meta(); ?>
       [LOTS OF OTHER CODE]
       </footer><!-- .entry-meta -->

    Questions:

    1. I don’t have a content.php file in my child theme. Do I need to create one? If so, what should it include? I’ve read you shouldn’t just copy the entire file from parent to child.

    2. Once I have a content.php file in my child theme, what do I write so the meta data function occurs after the title post, instead of in the post footer?

    If I wasn’t working with a child theme and just edited the parent theme files, I do know this works:

    – In content.php, delete the line “<?php twentytwelve_entry_meta(); ?>” that exists in the <footer class=”entry-meta”> section.
    – Insert the following text immediately after </header><!– .entry-header –>:

    <footer class="entry-meta">
        <?php twentytwelve_entry_meta(); ?>
    </footer><!-- .entry-meta -->

    But since best practice is to use a child theme, I suspect I need a slightly different strategy.

    Thank you for any help!

The topic ‘Edit child theme so function occurs in different place’ is closed to new replies.