Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $homepagePosts = new WP_Query(array(
- 'posts_per_page' => 2
- ));
- while ($homepagePosts->have_posts()) {
- $homepagePosts->the_post(); ?>
- <div>
- <a href="<?php the_permalink(); ?>">
- <span><?php the_time('M'); ?></span>
- <span><?php the_time('d'); ?></span>
- </a>
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <p>
- <?php echo wp_trim_words(get_the_content(), 18); ?>
- <a href="<?php the_permalink(); ?>">View more</a>
- </p>
- </div>
- <?php } wp_reset_postdata();
- ?>
Add Comment
Please, Sign In to add comment