Answers for "display custom post type post by id"

PHP
0

display all custom post type ids

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    the_ID();
endwhile;
Posted by: Guest on April-23-2021
0

display custom post type

$args = array(  
        'post_status' => 'publish',
        'posts_per_page' => 5,  
        
		);
	
    $loop = new WP_Query( $args ); 
        
    while ( $loop->have_posts() ) : $loop->the_post(); 
        the_title(); 
	the_excerpt();
    endwhile;
Posted by: Guest on July-22-2020

Code answers related to "display custom post type post by id"

Browse Popular Code Answers by Language