StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   category recent thumbnails reverts back to mixed thumbnails (http://www.studiopress.com/support/showthread.php?t=12331)

excitedrod 08-10-2009 07:46 AM

category recent thumbnails reverts back to mixed thumbnails
 
Hello,

I managed to get the 'recent photos' to show the relevant category thumbnails for that category being viewed.

However after you click on one of the recent photos thumbnails, the next page it brings up has the thumbnails from all categories below it. Can I get it to show just the recent photos from the same category?

It also says 'comments are closed' on those pages, how can i get rid of them?

eg http://meyouphotography.com/?p=114

Thanks for your help

SoZo 08-10-2009 08:01 AM

Re: category recent thumbnails reverts back to mixed thumbnails
 
For the comments open index.php and delete this:
Code:

<div class="commentsleft">
               
                        <?php comments_template('',true); ?>
                       
                </div>

And to get different recent photos for each category you will need to create several different recent.php files and then set some sort of conditional statement to call the appropriate file also in index.php

http://codex.wordpress.org/Conditional_Tags

excitedrod 08-10-2009 07:56 PM

Re: category recent thumbnails reverts back to mixed thumbnails
 
Thanks.

I don't know enough php to do the conditional statements. But found a post by steveayres with the following code for recent.php which did the job:

<div id="photos">

<?php $categories = get_the_category(); $category = $categories[0]; $cat_ID = $category->cat_ID;?>
<h3>Recent <?php echo($category->cat_name);?> Photography</h3>
<?php $recent = new WP_Query("cat=$cat_ID&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
[img]<?php echo get_post_meta($post->ID, [/img]" alt="<?php the_title(); ?>" />
<?php endwhile; ?>

</div>

SoZo 08-10-2009 08:07 PM

Re: category recent thumbnails reverts back to mixed thumbnails
 
Great! Glad you got it figured out.

buzybonnie 08-25-2009 01:27 AM

Re: category recent thumbnails reverts back to mixed thumbnails
 
just as an fyi to others who read this. Adew posted a solution to getting the thumbnails to be from categories in one of the other posts also discussing categorical thumbnails. Solution also uses conditional statements but within just one recent.php file and it works! :D.

SoZo 08-25-2009 01:57 AM

Re: category recent thumbnails reverts back to mixed thumbnails
 
Care to provide a link?

buzybonnie 08-25-2009 08:34 AM

Re: category recent thumbnails reverts back to mixed thumbnails
 
Thanks for the code on removing the closed comments. worked like a charm. my site is looking much better now :).

Link for the thumbnails by category that also uses conditional statement is viewtopic.php?f=32&t=6442&start=40

Adew's code that did finally work is on page 3.


All times are GMT -5. The time now is 05:21 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.