Created
March 25, 2013 10:32
-
-
Save michaeloeser/5236252 to your computer and use it in GitHub Desktop.
WordPress Custom Loop
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 $custom_query = new WP_Query('cat=-9'); // exclude category 9 | |
while($custom_query->have_posts()) : $custom_query->the_post(); ?> | |
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>"> | |
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> | |
<?php the_content(); ?> | |
</div> | |
<?php endwhile; ?> | |
<?php wp_reset_postdata(); // reset the query ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to show a specific page do something like: