Advertisement
Guest User

post type output v2

a guest
Feb 28th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <?php
  2. //OUTPUT SECTION 1 POSTS
  3. $args = array( 'post_type' => 'section-1', 'posts_per_page' => 2 );
  4. $loop = new WP_Query( $args );
  5. while ( $loop->have_posts() ) :
  6. $loop->the_post();
  7. ?>
  8. <div class="post_introbox">
  9. <div class="post_titlebox">
  10. <h3 id="post-<?php echo the_ID() ?>">
  11. <a href="<?php echo the_permalink() ?>">
  12. <?php the_title() ?>
  13. </a>
  14. </h3>
  15. <p>
  16. <span>
  17. <?php echo get_the_author_link() ?>
  18. </span> &middot; <?php echo the_date('m.d.Y') ?>
  19. </p>
  20. </div> <!--close titlebox-->
  21. <div class="containerz">
  22. <a href="<?php echo the_permalink() ?>"><?php
  23. add_image_size( 'front-featured', 374, 250, array( 'center', 'center' ) ); // Hard crop left top
  24.  
  25. if ( has_post_thumbnail() ) {; // check if the post has a Post Thumbnail assigned to it.
  26. the_post_thumbnail( 'front-featured' );
  27. }
  28. ?></a>
  29. </div>
  30. <div class="section_link_box">
  31. <span class="section1">
  32. <a href="/blog/<?php get_post_type( $post ) ?>">
  33. <?php
  34. $category = get_the_category( $custompost );
  35. ?>
  36. <?php echo $category[0]->cat_name ?>
  37. </a>
  38. </span>
  39. </div><!--CLOSE SECTION_LINK_BOX-->
  40. <div class="spacer_one"></div>
  41.  
  42. <div class="introtext section1">
  43.  
  44. <?php echo the_excerpt() ?>
  45. <p class="more">
  46. <a href="<?php echo the_permalink() ?>">
  47. Continue Reading
  48. </a>
  49. </p>
  50. <div class="clearfloat"></div>
  51. </div>
  52. </div> <!--close introtext-->
  53.  
  54. <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement