Last active
November 3, 2020 12:29
-
-
Save sanjayatony/730a75056caca6e96603 to your computer and use it in GitHub Desktop.
loop custom post type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => 4, | |
'paged' => $paged | |
); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post();?> | |
<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2> | |
<span class="date"><?php the_date();?></span> | |
<?php the_content();?> | |
<?php endwhile;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment