Created
August 16, 2016 06:28
-
-
Save mzo84/cca58cee78cec35241bbea3c21962ac2 to your computer and use it in GitHub Desktop.
wordpress - query posts
This file contains 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 // The WordPress Loop - customized with query_posts | |
global $query_string; // grab the global query information | |
$posts = query_posts($query_string.'&cat=-9'); // exclude Asides category | |
if (have_posts()) : while (have_posts()) : the_post(); | |
... | |
endwhile; else: | |
... | |
endif; | |
wp_reset_query(); // reset the query | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment