Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: News Page 1 - Template
- *
- * A custom page template without sidebar.
- *
- * The "Template Name:" bit above allows this to be selectable
- * from a dropdown menu on the edit page screen.
- *
- * @package WordPress
- * @subpackage Twenty_Ten
- * @since Twenty Ten 1.0
- */
- get_header(); ?>
- <style type="text/css">
- <!--
- body {
- background:url(http://www.thejacksons.com/wp-content/uploads/2011/12/bg-header2.gif); background-repeat:repeat-x; background-position:top;
- }
- -->
- </style>
- <style type="text/css">
- div.background
- {
- width:300px;
- height:50px;
- background:url(http://www.thejacksons.com/wp-content/uploads/2011/12/post_title_bg.png) repeat;
- border:0px solid black;
- margin:-150px 0px 0px 0px;
- position:absolute;
- }
- div.transbox
- {
- width:300px;
- height:50px;
- margin:5px 0px 0px 5px;
- border:0px solid black;
- }
- div.transbox p
- {
- margin:0px 0px;
- font-weight:bold;
- color:#000000;
- }
- </style>
- <table width="1060" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="50" colspan="2" align="left" valign="top"><div style="margin-top:12px;"><center><img src="http://www.thejacksons.com/wp-content/uploads/2011/07/Title-Welcome.png" alt="The Only Source. Welcome to the Official Jacksons Website." width="815" height="28" border="0" /></center></div></td>
- </tr>
- <tr>
- <td height="400" colspan="2" align="left" valign="top">
- <div style="margin-left:70px; width:922px;">
- <table width="922" border="0" cellspacing="0" cellpadding="0" style="color:#000;">
- <tr>
- <td width="300" height="272" align="left" valign="top">
- <?php query_posts('category_name=jackson-5-news&posts_per_page=12&tag=news12999');
- //automatically get the last 12 posts of the 'jackson-5-news' category with tag 'news12999' ?>
- <?php while (have_posts()) : the_post(); ?>
- <?php if( $wp_query->current_post && ($wp_query->current_post)%3 == 0 ) : //add table html at the start of a new line of three posts ?>
- <tr>
- <td height="272" align="left" valign="top">
- <?php endif; ?>
- <!--Post Start <?php echo ($wp_query->current_post+1); ?> -->
- <table width="300" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="150" colspan="2" align="left" valign="top">
- <a class="hmfeature-links" href="<?php the_permalink() ?>">
- <?php the_post_thumbnail( 'single-post-thumbnail' ); ?>
- </a>
- <div class="background">
- <div class="transbox">
- <a class="hmfeature-links" href="<?php the_permalink() ?>">
- <span style="font-size:17px; line-height:1.0em;"><?php the_title(); ?></span>
- </a>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <td width="220" height="122" align="left" valign="top">
- <span style="color:#AEAEAE; font-size:11px;">Published on <?php the_time('F jS, Y') ?></span>
- <br />
- <?php the_excerpt(); ?>
- </td>
- <td width="80" align="left" valign="top">
- <div style="margin-top:40px; height:35px; font-size:35px; color:#AEAEAE;">
- <center>
- <fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count>
- </center>
- </div>
- <span style="color:#AEAEAE;"><center>Comments</center></span>
- </td>
- </tr>
- </table>
- <!--Post End <?php echo $count = ($wp_query->current_post+1); ?> -->
- <?php if( ($wp_query->current_post+1)%3 != 0 ) : // repeat table html between posts ?>
- </td>
- <td align="left" valign="top"> </td>
- <td width="300" align="left" valign="top">
- <?php endif; ?>
- <?php if( ($wp_query->current_post+1)%3 == 0 && $wp_query->current_post != 11 ) : // add table html after three posts, but not at the end ?>
- </td>
- </tr>
- <?php endif; ?>
- <?php endwhile; ?>
- <?php if( $count < 12 ) : //add empty table cells into non-filled table rows
- for($j=$count+1;$j<=(ceil($count/3)*3);$j++) { ?>
- <?php if( $j%3 != 0 ) : //between posts ?>
- </td>
- <td align="left" valign="top"> </td>
- <td width="300" align="left" valign="top">
- <?php elseif( $j%3 == 0 && $j != 12 ) : //after three posts, but not at the end ?>
- </td>
- </tr>
- <?php endif; ?>
- <?php
- }
- endif; //ends: if( $count < 12 ) ?>
- </td>
- </tr>
- </table>
- </div>
- <!--end of posts and columns -->
- </td>
- </tr>
- <tr>
- <td width="321" height="20" align="left" valign="top"> </td>
- <td width="739" align="left" valign="top"> </td>
- </tr>
- <tr>
- <td height="20" colspan="2" align="left" valign="top">
- </td>
- </tr>
- <tr>
- <td width="321" height="20" align="left" valign="top"> </td>
- <td width="739" align="left" valign="top"> </td>
- </tr>
- </table>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement