Sponsored Links
As you perhaps noticed, the theme have a custom archive page and search page where the articles are displayed width a 110 x 80 pixel thumbnail on the left side. Articles are also displayed on the homepage in the same way under the featured content slider. All 3 files (home.php, search.php and archive.php) make use of an external file called excrept.php and it’s located in the includes folder.
Basically it is an “IF” statement what do the following:
IF: there is a custom field called “Thumbnail”
THAN: Show the image from that custom field, re size it to 110 x 80 pixels and link to the article from where it’s belong.
ELSE: If there is no thumbnail image in the custom field show the image called Thumbnail.png from the themes images folder.
The code looks like this (in the excrept.php from includes folder):
<?php if( get_post_meta($post->ID, “Thumbnail”, true) ): ?>
<a class=”thumb” href=”<?php the_permalink() ?>” rel=”bookmark”><img src=”<?php echo get_post_meta($post->ID, “Thumbnail”, true); ?>” alt=”<?php the_title(); ?>” /></a>
<?php else: ?>
<a class=”thumb” href=”<?php the_permalink() ?>” rel=”bookmark”><img src=”<?php bloginfo(’template_url’); ?>/images/Thumbnail.png” alt=”<?php the_title(); ?>” /></a>
<?php endif; ?>
Bryce asked how to remove or replace the image without adding a custom field. There are some options of what you can do.
Use a single image to all your posts:
Simply replace the Thumbnail.png with your own image and this will be attached to every single article on homepage, search page and archives page.
Remove the “Read More” image if not using thumbnail in custom fields:
Find in excrept.php these lines:
<?php else: ?>
<a class=”thumb” href=”<?php the_permalink() ?>” rel=”bookmark”><img src=”<?php bloginfo(’template_url’); ?>/images/Thumbnail.png” alt=”<?php the_title(); ?>” /></a>
Delete the two lines. In this case if you add a thumbnail to your custom field it will show, if not you will see only the excerpt (part of your post) from your article.
Show the post all content instead of the excrept:
Find the line in excrept.php:
<?php the_excerpt(__(’Read More »’));?>
And replace it with this one:
<?php the_content(__(’Read More »’));?>
I hope this will help you customize better your theme, also check my other article about themes tutorial
Sponsored Links