Back to Community

How to Customize the Entry Meta in Twenty Twelve (Date, Author, Category)

14 threads Sep 10, 2025 ThemeTwenty twelve

Content

Many users of the Twenty Twelve theme want to customize the post information line, often called the "entry meta." This is the text that typically appears at the bottom of a post and reads something like "This entry was posted in Category on Date by Author." Common requests include moving this information to the top of a post, changing the wording, removing links from the date, or adjusting the spacing around it. This guide covers the most common solutions for these customizations.

Why This Happens

The Twenty Twelve theme, like many WordPress themes, has a specific template structure that determines where and how post metadata is displayed. The appearance and placement of this data are hardcoded into theme files like content.php and single.php. To change it, you must modify these templates, which is why creating a child theme is the universally recommended first step. This protects your changes from being overwritten when the theme receives an update.

Common Solutions

1. Creating a Child Theme (Essential First Step)

Before making any changes, you must create a child theme. This is a separate theme that inherits all the functionality and styling of Twenty Twelve but allows you to safely make modifications. Directly editing the parent theme files will result in your changes being lost the next time you update WordPress or the theme. The official WordPress Codex provides a guide on how to create a child theme.

2. Moving the Entry Meta from Bottom to Top

A frequent request is to move the entry meta from the bottom of a post to a position just below the title. This requires editing your child theme's content.php file.

  1. In your child theme, locate and open the content.php file. If it doesn't exist, copy it from the parent Twenty Twelve theme directory.
  2. Find the line: <footer class="entry-meta"> and the corresponding </footer> tag. This block contains the code for the entry meta.
  3. Cut this entire block of code.
  4. Paste it immediately after the line: <header class="entry-header"> and the </header> closing tag. This places the meta information directly below the post title.

Note: As seen in the sample threads, moving this block can sometimes cause layout issues, such as unwanted white space or the post content disappearing if the code is not moved correctly. Always test on a development or staging site first.

3. Changing the Wording and Content of the Entry Meta

To change the text from "This entry was posted in..." to something like "By [author] on [date]," you need to modify the template tag function. This code is typically found in the inc/template-tags.php file. You should copy this file to your child theme and modify it there. Look for the function twentytwelve_entry_meta() and edit the HTML and text within it to suit your needs. This is an advanced modification that requires comfort with PHP.

4. Adjusting Spacing and Margins

If the entry meta is too close to the title or content after moving it, you can adjust the spacing using CSS. This is the safest and easiest way to control visual design.

  • Use a tool like Firefox's Firebug or your browser's built-in developer tools to inspect the element and identify the correct CSS class.
  • Common classes to target are .entry-meta or .entry-header.
  • Add CSS rules to your child theme's style.css file or a custom CSS plugin. For example, to add space below the title, you might use:
    .entry-header { margin-bottom: 20px; }
    Or to add space above the meta data:
    .entry-meta { margin-top: 15px; }
  • Adjust the pixel values until you achieve the desired spacing.

5. Removing the Link from the Date

To display the date without it being a hyperlink, you must, again, modify the template tags. Within the twentytwelve_entry_meta() function in your child theme's copy of template-tags.php, you would find the code that outputs the linked date and replace it with a function that outputs just the date without a link. This involves replacing the_date() wrapped in an <a> tag with a simpler function like get_the_date().

Conclusion

Customizing the entry meta in the Twenty Twelve theme is a common task that involves editing theme template files and CSS. The key to doing this successfully is always to work within a child theme to future-proof your website. While moving HTML blocks is a straightforward process, changing the wording or functionality of the meta data requires a deeper understanding of PHP and WordPress template tags.

Related Support Threads Support