Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Gallery
- */
- ?>
- <?php get_header(); ?>
- <div id="content">
- <!-- add page content from editor above gallery -->
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <div class="entry"><?php the_content(); ?></div>
- </div> <!-- end post -->
- <?php endwhile; endif; ?>
- <?php // ADD CUSTOM POST TYPE -> GALLERY in functions.php with sources below
- // http://www.vooshthemes.com/blog/wordpress-tip/create-a-professional-portfolio-using-wordpress-3-0-custom-post-types/
- // http://www.deluxeblogtips.com/2010/07/custom-post-type-with-categories-post.html
- if ( get_query_var('paged') ) {
- $paged = get_query_var('paged');
- } else if ( get_query_var('page') ) {
- $paged = get_query_var('page');
- } else {
- $paged = 1;
- }
- query_posts( array( 'post_type' => 'gallery', 'paged' => $paged, 'posts_per_page' => 8 ) );
- while (have_posts()) : the_post();
- ?>
- <div class="gallery">
- <h2><?php the_title(); ?></h2>
- <?php the_post_thumbnail('gallery'); ?>
- <?php the_content(); ?>
- </div><!-- END ".gallery" -->
- <?php endwhile; ?>
- <?php // pagination in functions.php from http://design.sparklette.net/teaches/how-to-add-wordpress-pagination-without-a-plugin/
- if (function_exists("pagination")) {
- pagination($additional_loop->max_num_pages);}
- ?>
- </div><!-- END "#content" -->
- </div><!-- END "#container" -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment