Bit Busy
23 Nov ’09
Boston Post – National Geographic Contest 09
24 Nov ’09

I’ve managed to tweak this theme to sort of do what i want it to do.

If you look at the image below you will see the tweet posts are all simply done with no heading or meta data. (i may add the date back in later) This is great but this happens only when you go to the tweets catagory page.

 tweets-good

This image shows the front page of the site but the tweets are not being displayed as per the tweets page.

 mixedWhat i want to happen is for the main page to show all the catagories but when it displays a tweet to display it like it does on the tweet page.

The code is thus:

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post();  ?>

<div>

<?php
if (is_category(28)) {
include(TEMPLATEPATH . ‘/tweetpost.php’);
} else {
include(TEMPLATEPATH . ‘/blogpost.php’);
}
?>

</div>

<?php comments_template(); ?>

<?php endwhile; ?>

<div>
<div><?php next_posts_link(‘&laquo; Older Entries’) ?></div>
<div><?php previous_posts_link(‘Newer Entries &raquo;’) ?></div>
</div>

<?php else : ?>

<h2>Not Found</h2>
<p>Sorry, but you are looking for something that isn’t here.</p>

<?php endif; ?>

The code for the “tweetpost.php” page is thus:

<?php include(TEMPLATEPATH.”/Cat_Thumb_Assign.php”);?>

<h1>

<?php the_content(‘Read the rest of this entry &raquo;’); ?>

</h1>

And the code for the “blogposts.php” page is thus:

<a href=”<?php the_permalink() ?>”>

<?php if( get_post_meta($post->ID, “hpbottom”, true) ): ?>

<img style=”” src=”<?php echo get_post_meta($post->ID, “hpbottom”, true); ?>” width=”100″ height=”100″  alt=”<?php the_title(); ?>” />

<?php else: ?>

<?php include(TEMPLATEPATH.”/Cat_Thumb_Assign.php”);?>

<?php endif; ?>

<h1><?php the_title(); ?></a></h1>

<small><?php the_time(‘F jS, Y’) ?> | <b>Author:</b> <?php the_author_posts_link(); ?> |
<b>Filed under:</b> <?php the_category(‘, ‘) ?>  <?php if ( $user_ID ) : ?> | <b>Modify:</b>
<?php edit_post_link(); ?> <?php endif; ?>|
<?php comments_popup_link(‘No Comments &#187;’, ‘1 Comment &#187;’, ‘% Comments &#187;’); ?></small>

<?php the_content(‘Read the rest of this entry &raquo;’); ?>

I know that some of my readers are wordpress junkies, so come on, step up to the plate, be a man lie you’ve never been a man before (especially apt if you are in fact a girl) and help me out my geeky bretheren…..

EDIT:

WP LOOP:

<!-- Start the Loop. -->
 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

 <!-- The following tests if the current post is in category 3. -->
 <!-- If it is, the div box is given the CSS class "post-cat-three". -->
 <!-- Otherwise, the div box will be given the CSS class "post". -->
 <?php if ( in_category('3') ) { ?>
           <div>
 <?php } else { ?>
           <div>
 <?php } ?>

 <!-- Display the Title as a link to the Post's permalink. -->
 <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

 <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
 <small><?php the_time('F jS, Y') ?> by <?php the_authors_post_link() ?></small>

 <!-- Display the Post's Content in a div box. -->
 <div>
   <?php the_content(); ?>
 </div>

 <!-- Display a comma separated list of the Post's Categories. -->
 <p>Posted in <?php the_category(', '); ?></p>
 </div> <!-- closes the first div box -->

 <!-- Stop The Loop (but note the "else:" - see next line). -->
 <?php endwhile; else: ?>

 <!-- The very first "if" tested to see if there were any Posts to -->
 <!-- display.  This "else" part tells what do if there weren't any. -->
 <p>Sorry, no posts matched your criteria.</p>

 <!-- REALLY stop The Loop. -->
 <?php endif; ?>

1 Comment

Leave a Reply