0

I v made a customization on my theme, and some widget display where only title is shown without thumb.But the thing is i dont know how to remove this thumb so i v made a custom thumb size and in function added size 0,0 but i want to remove it . So the thumb get generated and in category page it could be shown but inside this widget i dont want it there as this has slowed my site. This is a part of that widget with thumb inside

<div class="widget-container">
            <div class="widget-inner-list">
                <h4 class="widget-header"><?php echo $title; ?></h4>
                <ul class="catonlylist-links2">
                    <?php $recent = new WP_Query(array( 'cat' => $categories, 'showposts' => $posts_num )); while($recent->have_posts()) : $recent->the_post();?>
                    <li>
                        <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>
                        <div class="widget-img">
                            <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('lists'); ?></a>
                        </div><!--widget-img-->
                        <?php } ?>
                        <div class="catonlylist-links2-text">
                            <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>

                        </div><!--home-links2-text-->
                    </li>
                    <?php endwhile; ?>
                </ul>
            </div><!--widget-inner-list-->
        </div><!--widget-container-->

1 Answer 1

0

You should remove this part:

<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>
<div class="widget-img">
    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('lists'); ?></a>
</div><!--widget-img-->
<?php } ?>

.
Just to explain... This conditional statement askes... if there is a thumbnail run the code in between me and my closing tag...

<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>

<?php } ?>

This part "echoes" the thumbnail container (div) & its href wrapper & the thumbnail itself.

<div class="widget-img">
    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('lists'); ?></a>
</div><!--widget-img-->
2
  • Hey @kaiser (responding to your edit)... since he's a new user i thought i should help but to point that its not a wp question... i remember at the beginning i had some problem understanding the structure and where to post what ;)
    – Sagive
    Commented Oct 3, 2013 at 11:29
  • Completely understand that. If I would be an mod, I would've moved it to a comment.
    – kaiser
    Commented Oct 3, 2013 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.