Forums

show other posts of same category in sidebar when in single view? (1 post)

  1. pvf
    Member
    Posted 2 years ago #

    Hello everyone,

    i have come across what seems to be a huge obstacle im hoping someone can help me out or point me in the right direction!
    im using the YAPB plugin to post images and thumbnails throughout the site (which is not live yet).
    I was able to successfully restrict the thumbnails to their relative categories to appear when viewing that specific category using the code below.
    But NOW my issue is to get the same action when viewing a single post, the thumbnails disappear when in single view.

    <ul>
    <?php
    $categories=get_categories('');
    foreach ($categories as $cat){
    
    	if (is_category($cat->cat_ID)) {
    	query_posts('cat='.$cat->cat_ID.'&showposts=-1');
    	  while (have_posts()) : the_post();?>
        <?php  if ($post->image):  ?>
    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $post->image->getThumbnailHref(array('w=100','fltr[]=usm|30|0.5|3')) ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" width="100"/></a> </li>
    <?php endif; endwhile;
    }
    ?>
    </ul>

    i have tried to implement an is_single conditional within the foreach statement with the result being the same thumbnail repeating itself and loosing the other ones in that category....

    please im really close to getting this done! i hope someone can help!

    thanks in advance.
    pvf

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.