Guest User

Untitled

a guest
Jun 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2. $args = array(
  3. 'posts_per_page' => 1,
  4. 'meta_key' => 'meta-checkbox',
  5. 'meta_value' => 'yes'
  6. );
  7. $featured = new WP_Query($args);
  8.  
  9. if ($featured->have_posts()): while($featured->have_posts()):
  10. $featured->the_post(); ?>
  11. <h3><a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a></h3>
  12. <?php if (has_post_thumbnail()) : ?>
  13.  
  14. <figure> <a href="<?php the_permalink(); ?>"><?php
  15. the_post_thumbnail(); ?></a> </figure>
  16. <p><?php the_excerpt();?></p>
  17. <?php
  18. endif;
  19. endwhile; else:
  20. endif;
  21. ?>
  22.  
  23. <?PHP if( is_home() ) { ?>
  24.  
  25. <div> … </div>
  26.  
  27. <?PHP } ?>
  28.  
  29. <?php if( is_home() ) {
  30. $args = array(
  31. 'posts_per_page' => 1,
  32. 'meta_key' => 'meta-checkbox',
  33. 'meta_value' => 'yes'
  34. );
  35. $featured = new WP_Query($args);
  36.  
  37. if ($featured->have_posts()): while($featured->have_posts()):
  38. $featured->the_post(); ?>
  39. <h3><a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a></h3>
  40. <?php if (has_post_thumbnail()) : ?>
  41.  
  42. <figure> <a href="<?php the_permalink(); ?>"><?php
  43. the_post_thumbnail(); ?></a> </figure>
  44. <p><?php the_excerpt();?></p>
  45. <?php
  46. endif;
  47. endwhile; else:
  48. endif;
  49. endif;
  50. ?>
Add Comment
Please, Sign In to add comment