Advertisement
lancemoore

PHP

May 12th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. <?php
  2. require('wordpress/wp-blog-header.php');
  3. ?>
  4.  
  5. <?php if (have_posts()) : ?>
  6.  
  7. <?php if (($wp_query->post_count) > 3) : ?>
  8. <?php while (have_posts()) : the_post(); ?>
  9. <h2 id="post-<?php the_ID(); ?>">
  10. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  11. <?php the_title(); ?></a></h2>
  12. <?php the_content() ?>
  13. <p class="postmetadata">
  14. Posted in <?php the_category(', ') ?>
  15. <strong>|</strong>
  16. <?php edit_post_link('Edit','','<strong>|</strong>'); ?>
  17. <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
  18.  
  19. <?php endwhile; ?>
  20.  
  21. <?php else : ?>
  22.  
  23. <?php while (have_posts()) : the_post(); ?>
  24. <h2 id="post-<?php the_ID(); ?>">
  25. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  26. <?php the_title(); ?></a></h2>
  27. <?php the_content() ?>
  28. <!-- Do your post footer stuff here for single post-->
  29. <?php endwhile; ?>
  30.  
  31. <?php endif; ?>
  32.  
  33. <?php else : ?>
  34. <!-- Stuff to do if there are no posts-->
  35.  
  36. <?php endif; ?>
  37. <p class="postmetadata alt">
  38. <small>
  39. This entry was posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
  40. and is filed under <?php the_category(', ') ?>.
  41. You can follow any responses to this entry through
  42. the <?php comments_rss_link('RSS 2.0'); ?> feed.
  43. <?php
  44. if (('open' == $post->comment_status) && ('open' == $post->ping_status)) {
  45. // Both Comments and Pings are open
  46. ?>
  47. You can <a href="#respond">leave a response</a>, or
  48. <a href="<?php trackback_url(display); ?>">trackback</a>
  49. from your own site.
  50. <?php
  51. } elseif (!('open' == $post->comment_status) && ('open' == $post->ping_status)) {
  52. // Only Pings are Open
  53. ?>
  54. Responses are currently closed, but you can
  55. <a href="<?php trackback_url(display); ?> ">trackback</a>
  56. from your own site.
  57. <?php
  58. } elseif (('open' == $post->comment_status) && !('open' == $post->ping_status)) {
  59. // Comments are open, Pings are not
  60. ?>
  61. You can skip to the end and leave a response. Pinging is currently not allowed.
  62. <?php
  63. } elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
  64. // Neither Comments, nor Pings are open
  65. ?>
  66. Both comments and pings are currently closed.
  67. <?php
  68. }
  69. edit_post_link('Edit this entry.','',''); ?>
  70. </small>
  71. </p>
  72. <p class="postmetadata">
  73. Posted in <?php the_category(', ') ?>
  74. <strong>|</strong>
  75. <?php edit_post_link('Edit','','<strong>|</strong>'); ?>
  76. <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement