![]() |
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 |
Re: category recent thumbnails reverts back to mixed thumbnails
For the comments open index.php and delete this:
Code:
<div class="commentsleft">http://codex.wordpress.org/Conditional_Tags |
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> |
Re: category recent thumbnails reverts back to mixed thumbnails
Great! Glad you got it figured out.
|
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.
|
Re: category recent thumbnails reverts back to mixed thumbnails
Care to provide a link?
|
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.