• Resolved Jack Reichert

    (@jackreichert)


    I’m coding a theme and am setting up a list of the most recent articles in “featured” categories.

    I got everything working, except for the list part…
    Here is the code:

    <ul>
    	<tr>
    		<td>
    			<?php $cat_1 = new WP_Query('cat=1&posts_per_page=1'); ?>
    
    			<?php while ($cat_1->have_posts()) : $cat_1->the_post(); ?>
    				<?php if ( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail' ); else the_title(); ?>
    			<?php endwhile; ?>
    		</td>
    		<td>
    			<?php $cat_6 = new WP_Query('cat=6&posts_per_page=1'); ?>
    
    			<?php while ($cat_6->have_posts()) : $cat_6->the_post(); ?>
    				<?php if ( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail' ); else the_title(); ?>
    			<?php endwhile; ?>
    		</td>
    		<td>
    			<?php $cat_3 = new WP_Query('cat=3&posts_per_page=1'); ?>
    
    			<?php while ($cat_3->have_posts()) : $cat_3->the_post(); ?>
    				<?php if ( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail' ); else the_title(); ?>
    			<?php endwhile; ?>
    		</td>
    		<td>
    			<?php $cat_4 = new WP_Query('cat=4&posts_per_page=1'); ?>
    
    			<?php while ($cat_4->have_posts()) : $cat_4->the_post(); ?>
    				<?php if ( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail' ); else the_title(); ?>
    			<?php endwhile; ?>
    		</td>
    		<td>
    			<?php $cat_5 = new WP_Query('cat=5&posts_per_page=1'); ?>
    
    			<?php while ($cat_5->have_posts()) : $cat_5->the_post(); ?>
    				<?php if ( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail' ); else the_title(); ?>
    			<?php endwhile; ?>
    		</td>
    	</tr>
    </ul>

    {I shortened it into a sweet 5 liner loop but thought I’d post the whole code for perusal}

    In firebug it comes out only as:

    <ul>
    <img class="attachment-thumbnail wp-post-image" height="125" width="125" title="6a0105371af0f0970b0120a73d516d970b-800wi" alt="" src="https://localhost:8888/wordpress/wp-content/uploads/2009/11/6a0105371af0f0970b0120a73d516d970b-800wi-e1261756801711-125x125.jpg"/>
    <img class="attachment-thumbnail wp-post-image" height="125" width="125" title="Ubcity2" alt="" src="https://localhost:8888/wordpress/wp-content/uploads/2009/12/Ubcity2-e1261756660275-125x125.jpg"/>
    <img class="attachment-thumbnail wp-post-image" height="125" width="125" title="Alfa Romeo 33 racing" alt="" src="https://localhost:8888/wordpress/wp-content/uploads/2009/12/Alfa-Romeo-33-racing-150x150.jpg"/>
    <img class="attachment-thumbnail wp-post-image" height="125" width="125" title="1885 three cents rev" alt="" src="https://localhost:8888/wordpress/wp-content/uploads/2009/12/1885-three-cents-rev-150x150.jpg"/>
    <img class="attachment-thumbnail wp-post-image" height="125" width="125" title="Wenceslas Hollar - Strombus gigas" alt="" src="https://localhost:8888/wordpress/wp-content/uploads/2009/12/Wenceslas-Hollar-Strombus-gigas-e1261756458767.jpeg"/>
    </ul>

    The new thumbnail feature in 2.9 is working great though!

    Ideas why it might be ignoring my cells?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘My Theme is Ignoring <tr> <td> tags.’ is closed to new replies.