Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Product Page
- */
- ?>
- <?php get_header(); ?>
- <?php
- wp_enqueue_script('jquery');
- wp_enqueue_script('jquerymasonry', get_template_directory_uri(). '/js/jquery.masonry.js', array('jquery'));
- ?>
- <div id="container" class="containerfullwidth one-column one-columnfull">
- <div id="content" role="main">
- <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h1 class="page-title"><?php the_title(); ?></h1>
- <div class="entry-content">
- <?php //the_content(); ?>
- </div><!-- .entry-content -->
- <?php
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- query_posts(array('post_type' => 'product', 'post_status'=>'publish', 'paged' => $paged, 'posts_per_page' => 20));
- ?>
- <?php if ( ! have_posts() ) : ?>
- <div id="post-0" class="post error404 not-found">
- <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
- <div class="entry-content">
- <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
- <?php get_search_form(); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-0 -->
- <?php endif; ?>
- <div id="productgrid">
- <?php while ( have_posts() ) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('productlisting productlistinggrid'); ?>>
- <h2 class="entry-title entry-titlelisting"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- <div class="entry-content">
- <?php
- $id = $post->ID;
- if ( has_post_thumbnail() ) :
- echo get_the_post_thumbnail( $id, array(150, 150 ), array('class' => 'productsimage'));
- endif;
- //the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
- <?php the_excerpt( __( 'Continue reading <span class="meta-nav readmore">→</span>', 'twentyten' ) ); ?>
- <div class="clear"></div>
- <?php
- $id = $post->ID;
- //$id = 0, $taxonomy, $before = '', $sep = '', $after = ''
- ?>
- <?php
- /*
- $tags_list = get_the_term_list($id,'product_tag', '', ', ' );
- if ( $tags_list ):
- ?>
- <span class="tag-links">
- <?php printf( __( '<span class="%1$s">Tags:</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
- </span>
- <?php
- endif;
- */
- ?>
- </div><!-- .entry-content -->
- </div>
- <?php endwhile; // End the loop. Whew. ?>
- <div class="clr"></div>
- </div> <!-- end productgrid -->
- <?php if ( $wp_query->max_num_pages > 1 ) : ?>
- <!--div id="nav-below" class="navigation">
- <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
- <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
- </div--><!-- #nav-below -->
- <div class="clear"></div>
- <?php if(function_exists('wp_paginate')){wp_paginate();} ?>
- <div class="clear"></div>
- <?php endif; ?>
- <?php wp_reset_query(); //reset query ?>
- </div><!-- #post-## -->
- <?php endwhile; ?>
- </div><!-- #content -->
- </div><!-- #container -->
- <script type="text/javascript">
- (function( $ ) {
- $(document).ready(function() {
- var $container = $('#productgrid');
- $container.masonry({
- itemSelector : '.productlistinggrid',
- columnWidth : 440,
- gutterWidth : 20
- });
- });
- })( jQuery );
- </script>
- <?php //get_sidebar('product'); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement