Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Product List
- */
- $product_temp="true";
- get_header();
- $this_is_product=true;
- $box_counter="";
- ?>
- <?php
- if (get_option('rttheme_style')){
- $which_theme=get_option('rttheme_style');
- }else{
- $which_theme="1";
- }
- ?>
- <?php
- //call sub page header
- get_template_part( 'sub_page_header', 'sub_page_header_file' );
- ?>
- <div class="content_con2">
- <!-- left side content -->
- <div class="content productlist">
- <!-- box -->
- <div class="box single">
- <?php
- if (is_category()) {
- $page_title=single_cat_title("", false);
- }else{
- $page_title=single_post_title("", false);
- }
- ?>
- <!-- box title-->
- <h3><?php echo $page_title; ?></h3>
- <?php
- if(!$cat){
- if (have_posts()) : while (have_posts()) : the_post();$current_post=$post->ID;
- ?>
- <?php the_content(); ?>
- <?php endwhile; endif; }?>
- </div>
- <!-- /box -->
- <?php if ($cat || !get_option("rttheme_products_first_page_hide")):?>
- <?php
- $more = 0;
- //paging
- if (get_query_var('paged') ) {$paged = get_query_var('paged');} elseif ( get_query_var('page') ) {$paged = get_query_var('page');} else {$paged = 1;}
- if(is_category()){//category
- $query_string='cat='.get_query_var('cat').'&paged='.$paged.'&posts_per_page='.get_option("rttheme_product_list_pager").'&post_status=publish&orderby=date&order=DESC';
- }elseif(get_option('rttheme_portf_start_cat')){//start page with start category
- $query_string='cat='.get_option('rttheme_product_start_cat').'&paged='.$paged.'&posts_per_page='.get_option("rttheme_product_list_pager").'&post_status=publish&orderby=date&order=DESC';
- }else{//start page with all categories
- $query_string='cat='.get_option('rttheme_product_list_ex_cat[]').'&paged='.$paged.'&posts_per_page='.get_option("rttheme_product_list_pager").'&post_status=publish&orderby=date&order=DESC';
- }
- query_posts($query_string);
- ?>
- <div class="clear"></div>
- <!-- paging-->
- <div class="paging portfolio" style="margin-bottom:20px;">
- <ul>
- <?php get_pagination(); ?>
- </ul>
- </div>
- <!-- / paging-->
- <?php if (have_posts()) : while (have_posts()) : the_post();?>
- <!-- box -->
- <div class="box product">
- <img src="<?php echo get_template_directory_uri(); ?>/images/<?php echo $which_theme;?>/small_box_top.jpg" alt="" class="p_image_top" />
- <div class="imgarea product_image preload">
- <!-- product image -->
- <?php if(get_post_meta($post->ID, 'rt_product_image_url', true)):
- // Resize Image
- $imgURL = find_image_org_path(get_post_meta($post->ID, 'rt_product_image_url', true));
- $crop = true;
- if($imgURL) $image_thumb = @vt_resize( '', $imgURL, 160, 0, ''.$crop.'' );
- ?>
- <a href="<?php echo get_permalink() ?>" title="<?php the_title(); ?>">
- <img src="<?php echo $image_thumb["url"];?>" alt="<?php the_title(); ?>" class="image product_image preload" />
- </a>
- <?php endif;?>
- <!-- / product image -->
- </div>
- <div class="textarea">
- <!-- box title-->
- <h5><a href="<?php echo get_permalink() ?>" title=""><?php the_title(); ?></a></h5>
- <!-- text-->
- <?php echo get_post_meta($post->ID, 'rt_short_description', true);?>
- <?php if(get_post_meta($post->ID, 'rt_product_price', true)):?>
- <br />
- <span class="price"><?php echo get_post_meta($post->ID, 'rt_product_price', true);?></span>
- <?php endif;?>
- </div>
- <img src="<?php echo get_template_directory_uri(); ?>/images/<?php echo $which_theme;?>/small_box_bottom.jpg" alt="" class="p_image_bottom" />
- </div>
- <!-- /box -->
- <?php
- $box_counter++;
- if ($box_counter==3){
- echo "<div class=\"clear\"></div>";
- $box_counter=0;
- }
- ?>
- <?php endwhile; ?>
- <!-- /product boxes -->
- <div class="clear"></div>
- <?php else: ?>
- <p><?php _e('No product found.','rt_theme');?></p>
- <?php endif; ?>
- <?php endif;?>
- </div>
- <!-- / left side content -->
- <!-- side bar -->
- <div class="sidebar"><div class="sidebars1"><div class="sidebars2">
- <?php
- include(get_template_directory()."/sidebar.php");
- if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar For Products'));
- if (function_exists('dynamic_sidebar') && dynamic_sidebar('Common Sidebar'));
- if($cat){
- rt_ud_sidebars('cat',$cat);
- }else{
- rt_ud_sidebars('page',$current_post);
- }
- ?>
- </div></div></div>
- <div class="clear"></div>
- <!-- / side bar -->
- </div>
- <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement