Advertisement
Guest User

songoftheweek

a guest
Jul 8th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.72 KB | None | 0 0
  1.  <div class="SongOfTheWeek">
  2.  if (is_front_page()) {
  3.     <?php
  4.    // Feed PHP with the information you want to show, in our case: a certain category = use of the id, number = amount of posts to show
  5.    $catquery = new WP_Query( 'cat=77&posts_per_page=1' );
  6.    // Let WordPress run the loop for you
  7.    while($catquery->have_posts()) : $catquery->the_post();
  8. ?>
  9. <!--Inside the loop, you can use the WP template tags to show the stuff you want, like author, exerpt of the post etc. -->
  10. <?php the_post_thumbnail(); ?>
  11. <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
  12. <?php endwhile; ?>
  13. <?php // Don't forget to reset the query (clean the data after it is finished) ?>
  14. <?php wp_reset_query(); ?>
  15. }
  16. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement