Skip to content

Instantly share code, notes, and snippets.

@CEscorcio
Created July 18, 2013 14:18
Show Gist options
  • Save CEscorcio/6029719 to your computer and use it in GitHub Desktop.
Save CEscorcio/6029719 to your computer and use it in GitHub Desktop.
lists posts from a category that has the same name as the page.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; else: endif; ?>
<?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<p><?php the_content(); ?>
<?php endwhile; else: endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment