Disable Post Thumbnail in WordPress Hiero Theme
So I found a theme that works well for what I have posted on this site (so far), Hiero. However, I found a problem with how it handles images in conjunction with posts to Facebook and LinkedIn. Whenever it posts, it pulls an image from the media library. There's no way to define the image that it pulls to use for those posts without setting it as the "Featured Image" in each post or removing all media and having it use the Gravatar image on that profile.
In any case, neither of these were acceptable so my next option was to attempt to resize the image so it's smaller. I managed to do this by editing the styles.css and functions.php files, however, this still did not accomplish the desired results since it left a huge box where the original sized image would have fit. By this point I certainly was tired of messing with this so I decided to see if I could turn it off all together. It appears that I've found it!
NOTE TO THEME MAKER IF YOU READ THIS: Please fix this so you can choose the size of the image that appears on the front or provide an option to turn off displaying it with the post on the front page.
CAUTION: Before you do this, make sure any file you modify you take a backup of any files you're going to modify in case something goes horribly wrong.
You'll need to edit the content.php file in the theme directory. The original will have a section like the one shown below:
<?php if ( has_post_thumbnail() ) : ?> <div class="entry-thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php the_post_thumbnail( 'thumb-featured' ); ?> </a> </div> <div class="entry-summary"> <?php echo wpautop( $post->post_excerpt ? $post->post_excerpt : athemes_limit_string(strip_tags($post->post_content), 200) ); ?> <!-- .entry-summary --></div> <?php else : ?> <div class="clearfix entry-content"> <?php the_content( __( 'Continue Reading <span class="meta-nav">→</span>', 'athemes' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'athemes' ), 'after' => '</div>' ) ); ?> <!-- .entry-content --></div> <?php endif; ?>
The above section contains an if/else statement which controls whether the image is displayed or not. I simply removed the contents of the if section of the statement and copied in a duplicate entry of the else statement which means that it will perform the same task for both the if or the else conditions.
The final version should look roughly like the one below:
<?php if ( has_post_thumbnail() ) : ?> <div class="clearfix entry-content"> <?php the_content( __( 'Continue Reading <span class="meta-nav">→</span>', 'athemes' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'athemes' ), 'after' => '</div>' ) ); ?> <!-- .entry-content --></div> <?php else : ?> <div class="clearfix entry-content"> <?php the_content( __( 'Continue Reading <span class="meta-nav">→</span>', 'athemes' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'athemes' ), 'after' => '</div>' ) ); ?> <!-- .entry-content --></div> <?php endif; ?>
That should take care of the problem until/unless the authors are able to produce an update to this theme with the desired functionality.
NOTE: You will have to perform this action after any future theme updates that don't include this feature and the method to change it may differ in those versions, this information is provided for version 1.2 only.
0 Comments