StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-08-2009, 02:59 PM
Sandra Sandra is offline
Registered User
Pro Plus Member
 
Join Date: Mar 2009
Posts: 20
Default Customize recent.php to limit thumbnails by category

Hello -

I would like to add a set of thumbnails at the top of my category.php page to show only images from the current category.

referencing viewtopic.php?f=32&t=6442#p32301

I have done the following:

Created a file called recent-cat.php as follows:
Code:
<div id="photos-cat">
      
   <h3>This collection</h3>
   <?php $recent = new WP_Query("cat=".$image_cat."&showposts=50"); while($recent->have_posts()) : $recent->the_post();?>
   [img]<?php echo get_post_meta($post->ID, [/img]" alt="<?php the_title(); ?>" />            
   <?php endwhile; ?>
      
</div>
In category.php, added the following BEFORE the start of the loop:
Code:
<?php /* Template Name: Exhibits
*/ ?> 

<?php get_header(); ?>

<div id="content">

<?php
$category = get_the_category();
$image_cat=$category[0]->cat_ID;
?>

<?php include(TEMPLATEPATH."/recent-cat.php");?>

	<div class="contentleft">

<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string ."&showposts=50&paged=$page"); ?>

Created a #photos-cat { style

They layout looks fine but all the thumbnails are showing and not filtering for the current category.

Example is at http://doughaines.vinyltangerine.com/in ... abstracts/

Any advice as to what I missed would be greatly appreciated.

Best,
sandra
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eliminate limit of 15 recent posts SacramentoBill General Discussion 3 06-19-2010 09:03 AM
category recent thumbnails reverts back to mixed thumbnails excitedrod General Discussion 6 08-25-2009 08:34 AM
Changing Thumbnails from most Recent to a specifc Category buzybonnie General Discussion 2 08-21-2009 09:17 AM
Is it possible to limit items in recent.php by category? Whitehair General Discussion 2 07-27-2009 11:33 PM
Customize recent.php to use NextGen thumbnails sunbelle General Discussion 3 05-22-2009 02:57 AM


All times are GMT -5. The time now is 05:20 PM.

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