Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <?php if ( is_home() ) { ?>
  2. <?php $my_query = new WP_Query('posts_per_page=1');
  3. while ($my_query->have_posts()) : $my_query->the_post();
  4. $do_not_duplicate = $post->ID;?>
  5. <h1 class="post-title">
  6. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  7. <?php the_title(); ?></a></h1>
  8. <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --> | Category: <?php the_category(', ') ?></small>
  9. <?php the_content(); ?>
  10. <div class="read-more"><a href="<?php echo get_permalink(); ?>">Permalink</a></div>
  11. <?php endwhile; ?>
  12. <?php if (have_posts()) : while (have_posts()) : the_post();
  13. if( $post->ID == $do_not_duplicate ) continue; ?>
  14. <h1 class="post-title">
  15. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  16. <?php the_title(); ?></a></h1>
  17. <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --> | Category: <?php the_category(', ') ?></small>
  18. <?php the_excerpt(); ?>
  19. <div class="read-more"><a href="<?php echo get_permalink(); ?>">Read the Full Article</a></div>
  20. <?php endwhile; endif; ?>
  21. <?php } else { ?>
  22. <?php if (have_posts()) : while (have_posts()) : the_post();
  23. if( $post->ID == $do_not_duplicate ) continue; ?>
  24. <h1 class="post-title">
  25. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  26. <?php the_title(); ?></a></h1>
  27. <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --> | Category: <?php the_category(', ') ?></small>
  28. <?php the_excerpt(); ?>
  29. <div class="read-more"><a href="<?php echo get_permalink(); ?>">Read the Full Article</a></div>
  30. <?php endwhile; endif; ?>
  31. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement