I have a problem with the loop when I make a wp_query. See my code:
$query_video = new WP_Query( $args );
$args = array(
'post_type' => 'post',
'category_name' => 'videos',
'posts_per_page' => '4',
'orderby' => 'rand'
);
<?php if( $query_video->have_posts()) : while( $query_video->have_posts()) : $query_video->the_post(); ?>
What I'm trying to do:
- Bring only 4 random posts from the Videos category.
- This category of videos is of the Post-Format Video type (I think this does not influence much, since I'm trying to bring everything from the videos category.
Only he is not showing my loop! Could you give me a help?