0
I have a loop problem when I do 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 Videos is of the type Post-format Video ( I believe that this does not influence much, because I want to bring everything from the category videos.
Only he’s not showing my loop! Could you give me a Help?