wordpres get_posttype
if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
//if is true
}
wordpres get_posttype
if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
//if is true
}
wp_query get custom post type
<?php
$args = array(
'post_type' => 'custom_type',
'post_status' => 'publish',
'posts_per_page' => 8,
'orderby' => 'title',
'order' => 'ASC',
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
print the_title();
the_excerpt();
endwhile;
wp_reset_postdata();
?>
wordpress get post type
// Retrieves the post type of the current post or of a given post.
get_post_type( int|WP_Post|null $post = null )
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us