WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] My Theme is Ignoring <tr> <td> tags. (3 posts)

  1. Jack Reichert
    Member
    Posted 4 years ago #

    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="http://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="http://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="http://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="http://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="http://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!

  2. chdorner
    Member
    Posted 4 years ago #

    tr and td tags are for tables, if you want to make a list use li tags inside the ul tag (http://w3schools.com/html/html_lists.asp)

  3. Jack Reichert
    Member
    Posted 4 years ago #

    I've been working WAY too long today. I'm mixing lists and tables... my bad.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags