Return to Snippet

Revision: 61284
at December 4, 2012 07:14 by AndrewThinkUp


Updated Code
<?php

//  Override to remove Thematic's Post Thumbnails

function childtheme_override_content(){
    global $thematic_content_length;
  
    if ( strtolower($thematic_content_length) == 'full' ) {
      $post = get_the_content( thematic_more_text() );
      $post = apply_filters('the_content', $post);
      $post = str_replace(']]>', ']]&gt;', $post);
    } elseif ( strtolower($thematic_content_length) == 'excerpt') {
      $post = '';
      $post .= get_the_excerpt();
      $post = apply_filters('the_excerpt',$post);
    } elseif ( strtolower($thematic_content_length) == 'none') {
    } else {
      $post = get_the_content( thematic_more_text() );
      $post = apply_filters('the_content', $post);
      $post = str_replace(']]>', ']]&gt;', $post);
    }
    echo apply_filters('thematic_post', $post);
  } 


//  Override to add Post Thumbnails in their own DIV and open a new .post-body DIV

function childtheme_override_postheader() {
  global $post;
   
     if ( is_404() || $post->post_type == 'page') {
         $postheader = thematic_postheader_posttitle();        
     } 
     elseif ( has_post_thumbnail() && is_home()) {   
        $permalink = get_permalink($id);?>
        <div class="post-thumb"> <a class="entry-thumb" href="<?php echo $permalink; ?>">
        <?php $postheader = the_post_thumbnail(array(200, 200)); ?>
        </a></div><div class="post-body">
        <?php
        $postheader .= thematic_postheader_posttitle() . thematic_postheader_postmeta(); 
     }
     else {
         $postheader = thematic_postheader_posttitle() . thematic_postheader_postmeta();    
     }
     
     echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header
}

// Override to add in Closing div for .post-body 

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();
          } elseif ( post_type_supports( $post_type, 'comments') ) {
            $postfooter .= thematic_postfooter_posttax();
            $postfooter .= thematic_postfooter_postcomments();
          }
          // 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"; 
        if (is_home() && has_post_thumbnail()) {
        $postfooter .= '</div><!--.post-body-->';
        }
      }
      // Put it on the screen
      echo apply_filters( 'thematic_postfooter', $postfooter ); // Filter to override default post footer
}

Revision: 61283
at December 4, 2012 07:12 by AndrewThinkUp


Initial Code
//  Override to remove Thematic's Post Thumbnails
function childtheme_override_content(){
    global $thematic_content_length;
  
    if ( strtolower($thematic_content_length) == 'full' ) {
      $post = get_the_content( thematic_more_text() );
      $post = apply_filters('the_content', $post);
      $post = str_replace(']]>', ']]&gt;', $post);
    } elseif ( strtolower($thematic_content_length) == 'excerpt') {
      $post = '';
      $post .= get_the_excerpt();
      $post = apply_filters('the_excerpt',$post);
    } elseif ( strtolower($thematic_content_length) == 'none') {
    } else {
      $post = get_the_content( thematic_more_text() );
      $post = apply_filters('the_content', $post);
      $post = str_replace(']]>', ']]&gt;', $post);
    }
    echo apply_filters('thematic_post', $post);
  } 


//  Override to add Post Thumbnails in their own DIV and open a new .post-body DIV
function childtheme_override_postheader() {
  global $post;
   
     if ( is_404() || $post->post_type == 'page') {
         $postheader = thematic_postheader_posttitle();        
     } 
     elseif ( has_post_thumbnail() && is_home()) {   
        $permalink = get_permalink($id);?>
        <div class="post-thumb"> <a class="entry-thumb" href="<?php echo $permalink; ?>">
        <?php $postheader = the_post_thumbnail(array(200, 200)); ?>
        </a></div><div class="post-body">
        <?php
        $postheader .= thematic_postheader_posttitle() . thematic_postheader_postmeta(); 
     }
     else {
         $postheader = thematic_postheader_posttitle() . thematic_postheader_postmeta();    
     }
     
     echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header
}

// Override to add in Closing div for .post-body 
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();
          } elseif ( post_type_supports( $post_type, 'comments') ) {
            $postfooter .= thematic_postfooter_posttax();
            $postfooter .= thematic_postfooter_postcomments();
          }
          // 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"; 
        if (is_home() && has_post_thumbnail()) {
        $postfooter .= '</div><!--.post-body-->';
        }
      }
      // Put it on the screen
      echo apply_filters( 'thematic_postfooter', $postfooter ); // Filter to override default post footer
}

Initial URL


Initial Description
This is some code using Thematic Child Theme overrides to remove thematic's post thumbnails and add Post Thumbnails outside of the .entry-content <div> so that POst Thumbnails can be styled separated from all post Meta.  See this page for an example www.speiranconsulting.com/blog

Initial Title
Move Thematic Post Thumbnail Outside of Entry-content

Initial Tags
image, post, wordpress

Initial Language
PHP