2013-01-30, 04:30:13
(2013-01-30, 02:02:27)bensayers Wrote: Hi Jesusda, I tried out your code and it does indeed add a thumbnail to the full post page but it also adds a second thumbnail to the main Blog excerpt listing page. See below for a screenshot. Any chance you can modify your file to remove the second thumbnail? It's exactly what I need, thanks!
Hello Ben,
It was a bit confusing, but I think I've solved the problem and this version works fine. Let me know if there are some bugs
Here the new code:
PHP Code:
<p class="blog_post_content">
<?php
if(!isset($_GET['post']) && $blogSettings["postthumbnail"] == 'Y' && $blogSettings["postformat"] == "N" && !empty($post->thumbnail))
{
echo '<img src="'.$SITEURL.'data/uploads/'.$post->thumbnail.'" style="" class="blog_post_thumbnail" />';
}
if($excerpt == false || $excerpt == true && $blogSettings["postformat"] == "Y")
{
if( $blogSettings["postthumbnail"] == 'Y' && !empty($post->thumbnail))
{
echo '<img src="'.$SITEURL.'data/uploads/'.$post->thumbnail.'" style="" class="blog_post_thumbnail" />';
}
echo html_entity_decode($post->content);
}
else
{
if($excerpt == true && $blogSettings["postformat"] == "N")
{
if($blogSettings["excerptlength"] == '')
{
$excerpt_length = 250;
}
else
{
$excerpt_length = $blogSettings["excerptlength"];
}
if( $blogSettings["postthumbnail"] == 'N' && !empty($post->thumbnail))
{
echo '<img src="'.$SITEURL.'data/uploads/'.$post->thumbnail.'" style="" class="blog_post_thumbnail" />';
}
echo $Blog->create_excerpt(html_entity_decode($post->content), 0, $excerpt_length);
echo '...';
}
}
if(!isset($_GET['post']) && $blogSettings['displayreadmore'] == 'Y')
{
echo '  <br /><a href="'.$url.'" class="read_more_link">'.$blogSettings['readmore'].'</a>';
}
?>
</p>
And here the complete file: