Skip to content

Instantly share code, notes, and snippets.

@CSJudd
Created November 15, 2010 22:13
Show Gist options
  • Save CSJudd/701055 to your computer and use it in GitHub Desktop.
Save CSJudd/701055 to your computer and use it in GitHub Desktop.
<?php
$loop = new WP_Query( array( 'post_type' => 'event', 'posts_per_page' => 10 ) );
if ( $loop->have_posts() ) while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'TRBC' ), 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'TRBC' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
<br />
<hr>
<br />
</div><!-- #post-## -->
<!--?php comments_template( '', true ); ?-->
<?php endwhile; ?>
@CSJudd
Copy link
Author

CSJudd commented Nov 15, 2010

Added $loop variable and logic to the if/while to pull only the custom 'event' post_type and paginate, and added visual elements (br and hr tags) for display

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment