سلام دوستان
من این کد رو برای خروجی گرفتن یک سری مطالب از سایتم نوشتم.
<?php
$cat_id = get_cat_ID( single_cat_title("",false) );
global $post;
$args = array(
'post_type' => 'post',
'posts_per_page' => 6,
'category' => $cat_id,
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => 'post-format-image',
'operator' => 'NOT IN',
))
);
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post);
the_title( '<h4>', '</h4>' );
endforeach;
?>
متاسفان