Post format selector in Thematic child theme post class

I’m having a very hard time implementing post formats in my Thematic child theme. I am able to add post format theme support and add content via the big conditional statement, but the .format-video, etc. selectors do not appear in the post class so I can’ use them to style the formats.

According to some echoing tests, the selector appears as it should in post_class() but is nowhere to be found in thematic_post_class().
I tried removing thematic_post_class() to let post_class() function instead:

// remove thematic_post_class to include post format selector in post class
function childtheme_override_post_class() {
     remove_action('thematic_post_class','thematic_access', 9);
}
add_action('init', 'childtheme_override_post_class');

With this function, thematic_post_class() no longer echoes, but the theme is still not registering the format selectors. I saw in another post that the after_setup_theme action hook worked to enable formats in a Twenty-Ten child – tried this in my theme but it made no difference:

function wpfolio_add_format_support() {
    add_theme_support( 'post-formats', array( 'aside', 'gallery', 'video', 'link', 'image', 'quote') );
}
add_action('after_setup_theme', 'wpfolio_add_format_support', 11);`

Any ideas? Thanks in advance

1 Answer
1

Okay, I’m going on the assumption that the real question is “how do I get Thematic to add the post-format to its body classes?”

Try this in your functions.php:

function my_thematic_post_format_class( $classes = array() ) {
  $format = get_post_format();
  if ( '' == $format )
    $format="standard";

  $classes[] = 'format-' . $format;

  return $classes;
}

add_filter( 'post_class', 'my_thematic_post_format_class' );

Don’t override the thematic post class functions. Just add that filter, and you should be good.

Leave a Comment