Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <figure id="blog-widget-home" class="widget effect-bubba">
  2.                     <figcaption>
  3.                         <h4 class="widget-title">Our Blog</h4>
  4.                         <?php
  5.                         // The Query
  6.                         $the_query = new WP_Query(
  7.                             array
  8.                             (
  9.                             'category_name=blog',
  10.                             'posts_per_page' => 1
  11.                             )
  12.                         );
  13.                         // The Loop
  14.                         if ( $the_query->have_posts() ) {
  15.                             while ( $the_query->have_posts() ) {
  16.                                 $the_query->the_post();
  17.                                 echo '<h3 class="post-title-widget"><a href="'. get_the_permalink() . '">' . get_the_title() . '</a></h3>';
  18.                                 echo '<p>test</p>';
  19.                                 echo '<p class="subtitle">' . the_field('post_subtitle') . '</p>';
  20.                             }
  21.                         } else {
  22.                             // no posts found
  23.                         }
  24.                         /* Restore original Post Data */
  25.                         wp_reset_postdata();
  26.                         ?>
  27.                     </figcaption>          
  28.             </figure>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement