ThemeShaper Forums » Thematic


Customizing Meta Data

(5 posts)
  • Started 8 years ago by ismh
  • Latest reply from Andrew
  • This topic is not resolved


  1. ismh

    I'm looking at customizing the meta data in the theme. This is two-fold:

    1. On the main blog page, I'd like just the date to appear
    2. On single pages, I'd like the date and categories to appear.

    I've been playing with this some, but haven't had a ton of luck. Thanks!

    Posted 8 years ago #
  2. Hi Ismh,

    You need to put some of Thematic's Child Theme Overrides into you child themes functions.php Something like this might work..

    function childtheme_override_postheader() {
    	  global $post;
     	   if ( is_404() || $post->post_type == 'page') {
     	       $postheader = thematic_postheader_posttitle();
              elseif (is_front_page() ){
                 $postheader =  thematic_postheader_postmeta();
    else {
     	       $postheader = thematic_postheader_posttitle() . thematic_postheader_postmeta();
     	   echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header

    This would set your homepage to not show the Post title, just the PostMeta, which includes the Author, date and categories. But then to make it only show the date, you'd have to apply the Child Theme override to the thematic_postheader_postmeta function as well, this time removing the Author info and categories with an 'if is_front_page()' statement.

    Hope that helps!

    Posted 8 years ago #
  3. since there is an apply_filters (which is the sign that there is a filter available) you could also filter thematic_postheader

    though you might be better off filtering thematic_postheader_postmeta

    Posted 8 years ago #
  4. ismh

    Andrew, Thanks for the help. I don't think I was clear — the title needs to show on both. I'm just trying to have the metadata different on the main page and on single pages.

    Posted 8 years ago #
  5. Then in that case, you should use the Child theme override for the post header post meta like so..

    function childtheme_override_postheader_postmeta() {
         if (is_front_page()){
            // put your altered post meta in here..
         else {
                $postmeta = '<div class="entry-meta">';
    	    $postmeta .= thematic_postmeta_authorlink();
    	    $postmeta .= '<span class="meta-sep meta-sep-entry-date"> | </span>';
    	    $postmeta .= thematic_postmeta_entrydate();
    	    $postmeta .= thematic_postmeta_editlink();
    	    $postmeta .= "</div><!-- .entry-meta -->\n";
    	    return apply_filters('thematic_postheader_postmeta',$postmeta); 

    And to remove the categories you'd need to use another override for the thematic_category_archives. You can find which you need to override in the content-extensions.php in the library folder of thematic. And there's a list of Child Theme overrides available here..

    As Helga stated (and it's probably a better practice) you could also filter the thematic_postheader_postmeta because it has a filter available. I don't believe the thematic_category_archives offers a filter though, so the override seems like your best bet.

    Good luck!

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.