public
Created

Add Facebook comment count to Thematic

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
// scottnix.com
// add facebook comment count to Thematic, really we are just removing the lines that thematic customizes and adding back in the WP defaults
function childtheme_override_postfooter() {
$post_type = get_post_type();
$post_type_obj = get_post_type_object($post_type);
 
// Check for "Page" post-type and logged in user to show edit link
if ( $post_type == 'page' && current_user_can('edit_posts') ) {
$postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
$postfooter .= "</div><!-- .entry-utility -->\n";
// Display nothing for logged out users on a "Page" post-type
} elseif ( $post_type == 'page' ) {
$postfooter = '';
// For post-types other than "Pages" press on
} else {
$postfooter = '<div class="entry-utility">';
if ( is_single() ) {
$post_type_archive_link = ( function_exists( 'get_post_type_archive_link' ) ? get_post_type_archive_link( $post_type ) : home_url( '/?post_type=' . $post_type ) );
if ( thematic_is_custom_post_type() && $post_type_obj->has_archive ) {
$postfooter .= __('Browse the ', 'thematic') . '<a href="' . $post_type_archive_link . '" title="' . __('Permalink to ', 'thematic') . $post_type_obj->labels->singular_name . __(' Archive', 'thematic') . '">';
$postfooter .= $post_type_obj->labels->singular_name . '</a>' . __(' archive', 'thematic') . '. ';
}
$postfooter .= thematic_postfooter_posttax();
// $postfooter .= __('Bookmark the ', 'thematic') . '<a href="' . apply_filters('the_permalink', get_permalink()) . '" title="' . __('Permalink to ', 'thematic') . the_title_attribute('echo=0') . '">';
// $postfooter .= __('permalink', 'thematic') . '</a>. ';
if ( post_type_supports( $post_type, 'comments') ) {
// remove the damn postconnect, since it displays on the below the comments it is useless
$postfooter .= '';
}
} elseif ( post_type_supports( $post_type, 'comments') ) {
$postfooter .= thematic_postfooter_posttax();
// here we swap out the thematic comment number for the default for WordPress, which facebook filters.
$postfooter .= comments_number();
}
// Display edit link
if (current_user_can('edit_posts')) {
if ( !is_single() && post_type_supports( $post_type, 'comments') ) {
$postfooter .= "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-edit">|</span> ';
}
$postfooter .= ' ' . thematic_postfooter_posteditlink();
}
$postfooter .= "\n\n\t\t\t\t\t</div><!-- .entry-utility -->\n";
}
// Put it on the screen
echo apply_filters( 'thematic_postfooter', $postfooter ); // Filter to override default post footer
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.