Advertisement
toxiccosmos

tcp loop 2013

Jul 6th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.24 KB | None | 0 0
  1. <?php
  2. /**
  3.  * This file is part of TheCartPress.
  4.  *
  5.  * This program is free software: you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation, either version 3 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17.  */
  18.  
  19. /**
  20.  * The loop that displays products in configurable UL,LI mode.
  21.  *
  22.  * @package TheCartPRess
  23.  * @subpackage
  24.  * @since 1.1.3
  25.  */
  26. ?>
  27.  
  28. <?php /* If there are no products to display, such as an empty archive page */ ?>
  29. <?php if ( ! have_posts() ) : ?>
  30.       <article id="post-0" class="post no-results not-found">
  31.           <header class="entry-header">
  32.               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  33.           </header><!-- .entry-header -->
  34.  
  35.           <div class="entry-content">
  36.               <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?>
  37.             </p>
  38.               <?php get_search_form(); ?>
  39.           </div><!-- .entry-content -->
  40.       </article><!-- #post-0 -->
  41. <?php endif; ?>
  42.  
  43. <?php
  44. $currency = tcp_the_currency( false );
  45. if ( ! isset( $instance ) ) $instance = get_option( 'ttc_settings' );
  46. $see_title              = isset( $instance['see_title'] ) ? $instance['see_title'] : true;
  47. $title_tag              = isset( $instance['title_tag'] ) ? $instance['title_tag'] : '';
  48. $see_image              = isset( $instance['see_image'] ) ? $instance['see_image'] : true;
  49. $image_size             = isset( $instance['image_size'] ) ? $instance['image_size'] : 'true';
  50. $see_excerpt            = isset( $instance['see_excerpt'] ) ? $instance['see_excerpt'] : true;
  51. $see_content            = isset( $instance['see_content'] ) ? $instance['see_content'] : false;
  52. $see_price              = isset( $instance['see_price'] ) ? $instance['see_price'] : true;
  53. $see_buy_button         = isset( $instance['see_buy_button'] ) ? $instance['see_buy_button'] : false;
  54. $see_author             = isset( $instance['see_author'] ) ? $instance['see_author'] : false;
  55. $see_posted_on          = isset( $instance['see_posted_on'] ) ? $instance['see_posted_on'] : false;
  56. $see_taxonomies         = isset( $instance['see_taxonomies'] ) ? $instance['see_taxonomies'] : false;
  57. $see_meta_utilities     = isset( $instance['see_meta_utilities'] ) ? $instance['see_meta_utilities'] : false;
  58. $see_sorting_panel      = isset( $instance['see_sorting_panel'] ) ? $instance['see_sorting_panel'] : false;
  59. $number_of_columns      = isset( $instance['columns'] ) ? (int)$instance['columns'] : 2;
  60. //custom areas. Usefull to insert other template tag from WordPress or another plugins
  61. $see_first_custom_area  = isset( $instance['see_first_custom_area'] ) ? $instance['see_first_custom_area'] : false;
  62. $see_second_custom_area = isset( $instance['see_second_custom_area'] ) ? $instance['see_second_custom_area'] : false;
  63. $see_third_custom_area  = isset( $instance['see_third_custom_area'] ) ? $instance['see_third_custom_area'] : false;
  64. $see_pagination         = isset( $instance['see_pagination'] ) ? $instance['see_pagination'] : false;
  65. $column = $number_of_columns;
  66.  
  67. if ( isset( $instance['title_tag'] ) && $instance['title_tag'] != '' ) {
  68.     $title_tag = '<' . $instance['title_tag'] . ' class="entry-title">';
  69.     $title_end_tag = '</' . $instance['title_tag'] . '>';
  70. } else {
  71.     $title_tag = '';
  72.     $title_end_tag = '';
  73. }
  74. ?>
  75.  
  76. <?php if ( $see_sorting_panel ) {
  77.     tcp_the_sort_panel();
  78. } ?>
  79.  
  80. <?php /* Start the Loop.*/ ?>
  81.  
  82. <div id="left_gallery">
  83. <ul class="tcp_products_list">
  84. <?php
  85. while ( have_posts() ) : the_post();
  86.     if ( $column == 0 ) $column = $number_of_columns;
  87.     $tcp_col = $number_of_columns - $column + 1;
  88.     $class = array( 'tcp_' . $number_of_columns . '_cols', 'tcp_col_' . $tcp_col );
  89.     //$td_class = 'class="' . join( ' ', get_post_class( $class ) ) . '"'; ?>
  90.     <li id="td-post-<?php the_ID(); ?>" class="tcp_col <?php echo implode( ' ', $class ); ?>">
  91.     <?php $column--;?>
  92.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  93.  
  94.             <div class="product">
  95.                                 <?php if ( $see_title ) : ?><?php if ( $see_image ) : ?><a href="#dialog<?php the_ID(); ?>" title="<?php the_title(); ?>" rel="facebox"><?php if ( function_exists( 'the_post_thumbnail' ) ) the_post_thumbnail( 'thumbnail' ); ?></a><?php endif; ?><?php endif; ?>
  96.                         </div>
  97.                        
  98.            
  99.             <div id="dialog<?php the_ID(); ?>" class="window">
  100.                                 <div class="top">
  101.                                         <?php if ( $see_title ) : ?>
  102.                                         <?php echo $title_tag;?>
  103.                                         <h3 class="title"><?php the_title(); ?></h3>
  104.                                         <?php echo $title_end_tag;?>
  105.                                         <?php endif; ?>
  106.                                        
  107.                                 </div>
  108.                                
  109.                                 <div class="left">
  110.                                         <?php if ( $see_image ) : ?><?php if ( function_exists( 'the_post_thumbnail' ) ) the_post_thumbnail( 'large' ); ?><?php endif; ?>
  111.                                 </div>
  112.                                 <div class="right">
  113.                                         <?php if ( $see_price ) :?>
  114.                                         <p class="price">Price: <?php tcp_the_price_label();?></p>
  115.                                         <?php endif;?>
  116.                                        
  117.                     <?php the_content(); ?>
  118.                                        
  119.                                         <div id="cart"><span style="float:left; display:none;"><img src="../wp-content/themes/soulabstract_v1/images/shopcart.png" /></span><span style="float:right"><a href="http://www.soulabstract.com/contact/"><img src="http://www.soulabstract.com/wp-content/themes/soulabstract_v1/images/contactmfp.jpg" /></a><span style="display:none"><?php tcp_the_buy_button( $post_id, true ); ?></span></style></div>
  120.                                 </div>
  121.            
  122.                         </div>  
  123.                                
  124.            
  125.             <div id="mask"></div>
  126.            
  127.         </div><!-- #post-## -->
  128. </li>
  129.  
  130. <?php endwhile; // End the loop ?>
  131. <?php for(; $column > 0; $column-- ) :
  132.     $class = array( 'tcp_' . $number_of_columns . '_cols', 'tcp_col_' . ++$tcp_col );?>
  133.     <li class="tcp_col <?php echo implode( ' ', $class ); ?> tcp_td_empty">&nbsp;</li>
  134. <?php endfor; ?>
  135. </ul>
  136. </div>
  137. <div id="right_gallery">
  138.    
  139.         <?php
  140.     query_posts('p=250');
  141.     while (have_posts()) : the_post();
  142.     endwhile;
  143.     ?>
  144.  
  145.     <?php the_content('Read More &raquo;'); ?>
  146.    
  147. </div>
  148.  
  149. <span style="clear:both"></span>
  150. <?php /* Display pagination */
  151. if ( $see_pagination ) tcp_get_the_pagination(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement