i'm using this plugin to add images, for each post, to my category pages. the readme file for this plugin says to add this line of code <?php get_the_image(); ?> PHP: "within the loop". so below is the code for my category.php page, and i do see where it says 'loop', but I don't know the proper syntax of how to instert the code above and where. <?php $category_description = category_description(); if ( ! empty( $category_description ) ) echo '<div class="archive-meta">' . $category_description . '</div>'; /* Run the loop for the category page to output the posts. * If you want to overload this in a child theme then include a file * called loop-category.php and that will be used instead. */ get_template_part( 'loop', 'category' ); ?> PHP: please advise. thanks!
Ok basically your theme is doing it the newer way. Instead of having the code for "the loop" repeated in all the various files, such as category.php, it uses a file called loop.php and just looks for the code in there that relates to category pages. Take a look in that file, if it's not obvious where the plugin code should go you can post your loop.php here or pm me or something and hopefully we can get you sorted out
That is Justin Tadlock's plugin and the function is going to need a filename for the image. This means either he is going to have one image for all categories or a method in the dashboard's Category menu to apply an image to each category specifically to pull that filename from.
There are a number of "loops" within that file. You have a loop for galleries, categories, archives, posts, etc. I think all but the Gallery loop may be appropriate to place the code. Per the Get the Image FAQ Page there are several methods, but in general, you would place this code in the position you want the thumbnail to appear: <?php if ( function_exists( 'get_the_image' ) ) get_the_image(); ?> PHP: A common place to insert the thumbnail would be right after the entry titles within each type of loop and before the entry meta information DIV blocks. In the all other posts section around line 127: <?php /* How to display all other posts. */ ?> <?php else : ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> [COLOR="red"]<?php if ( function_exists( 'get_the_image' ) ) get_the_image(); ?>[/COLOR] <div class="entry-meta"> <?php twentyten_posted_on(); ?> </div><!-- .entry-meta --> Code (markup): There are other loops to place this code within. Look for the Heading elements and meta blocks inside the code.
That code works for listing posts. Check your category pages, tag pages, etc. I think you will find that the thumbnails are not present on them. You will need to sort thru the code and place that snippet in the same area between title and meta block.