query_carti
// WP_Query arguments
$args = array(
'pagename' => 'carti',
'post_type' => array( 'carti_post_type' ),
'post_status' => array( 'publish' ),
'author_name' => 'Libraria',
'nopaging' => false,
'posts_per_page' => '5',
'posts_per_archive_page' => '5',
'order' => 'ASC',
'orderby' => 'name',
);
// The Query
$querycarti = new WP_Query( $args );
// The Loop
if ( $querycarti->have_posts() ) {
while ( $querycarti->have_posts() ) {
$querycarti->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();