Created
October 11, 2019 09:17
-
-
Save Farmatique/64e7ff3eaee2134b346b576c2ca936eb to your computer and use it in GitHub Desktop.
Wordpress create query to get posts with specifica category name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $query = new WP_Query( array( 'category_name' => 'blog' ) ); ?> | |
<?php while ($query->have_posts()) : $query->the_post(); ?> | |
<?php get_template_part('partials/content-category-blog'); ?> | |
<?php | |
endwhile; | |
wp_reset_query(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment