Posted By

jamigibbs on 01/25/11


Tagged

page wordpress


Versions (?)

Display a Page in Wordpress for Premium Football Theme


 / Published in: PHP
 

You need to replace $post_id with the ID of the page you want to display. If you want a thumbnail displayed (like the other posts), then assigned a Featured Image to the page just as you would with regular posts.

  1. <div class="single-page">
  2. <?php
  3. $post_id = 145;
  4. $queried_post = get_post($post_id);
  5. ?>
  6. <h3 style="color:#333;font-size:20px;text-transform:uppercase;margin-bottom:10px;"><?php echo $queried_post->post_title; ?></h3>
  7. <div class="meta">
  8. <p class="feat-post-details">Posted by <?php the_author_posts_link(); ?> on <?php the_time('F jS, Y') ?> in <?php the_category(', ') ?> | <a class="comments" href="<?php comments_link(); ?> "><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a></p>
  9. </div>
  10.  
  11. <?php if ( has_post_thumbnail() ) { ?>
  12. <?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?>
  13. <a href="<?php the_permalink() ?>"><img class="home-thumbnail" src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $thumbnail[0]; ?>&h=170&w=170&zc=1" alt="" /></a>
  14. <?php } ?>
  15. <div style="color:#333333"><?php echo $queried_post->post_content; ?></div>
  16.  
  17. </div> <!-- end .single-page -->

Report this snippet  

You need to login to post a comment.