Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <figure id="blog-widget-home" class="widget effect-bubba">
- <figcaption>
- <h4 class="widget-title">Our Blog</h4>
- <?php
- // The Query
- $the_query = new WP_Query(
- array
- (
- 'category_name=blog',
- 'posts_per_page' => 1
- )
- );
- // The Loop
- if ( $the_query->have_posts() ) {
- while ( $the_query->have_posts() ) {
- $the_query->the_post();
- echo '<h3 class="post-title-widget"><a href="'. get_the_permalink() . '">' . get_the_title() . '</a></h3>';
- echo '<p>test</p>';
- echo '<p class="subtitle">' . the_field('post_subtitle') . '</p>';
- }
- } else {
- // no posts found
- }
- /* Restore original Post Data */
- wp_reset_postdata();
- ?>
- </figcaption>
- </figure>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement