Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ribbon is added. pagination is styled.

  • Loading branch information...
commit 63c476a942433da7b703653069abc3f3882cbd99 1 parent 684a0a1
Zakir authored May 16, 2012
61  category.php
@@ -7,6 +7,7 @@
7 7
 
8 8
 <div id="cat-container">
9 9
 <?php if (is_category()) { global $wp_query, $sort, $results, $paged;
  10
+$ribbon=0;
10 11
 ?>
11 12
 
12 13
 <div id="cat-sidebar" class="left-sidebar">	
@@ -175,7 +176,7 @@
175 176
 				$sort = get_option('current_sort', $sort);
176 177
 				$results = get_option('current_result', $results);		
177 178
 						if($sort=='high'){
178  
-						echo "high";
  179
+						//echo "high";
179 180
 							$args = array_merge( $wp_query->query, 
180 181
 							array(
181 182
 						   		'post_type' => 'post',
@@ -188,7 +189,7 @@
188 189
 							query_posts($args);
189 190
 							
190 191
 					 }elseif($sort=='low'){
191  
-					 echo "low";
  192
+					 //echo "low";
192 193
 					 	$args =  array_merge( $wp_query->query,
193 194
 							array(
194 195
 						   		'post_type' => 'post',
@@ -201,7 +202,8 @@
201 202
 							query_posts($args);
202 203
 					 
203 204
 					 }elseif($sort=='prod_picks'){
204  
-					 	echo "picks";
  205
+					 	//echo "picks";
  206
+					 	$ribbon=1;
205 207
 					 	$args =  array_merge( $wp_query->query,
206 208
 							array(
207 209
 						   		'post_type' => 'post',
@@ -214,7 +216,7 @@
214 216
 							query_posts($args);
215 217
 					 
216 218
 					 }elseif($sort=='prod_popularity'){
217  
-					 echo "pop";
  219
+					 //echo "pop";
218 220
 					 	$args =  array_merge( $wp_query->query,
219 221
 							array(
220 222
 						   		'post_type' => 'post',
@@ -228,8 +230,8 @@
228 230
 					 
229 231
 					 }else{
230 232
 					 	
231  
-					 	echo "default";
232  
-					 	$results = 3; // initially only 12 porducts will be displayed. Change 3 to 12. and sort by newest.
  233
+					 	//echo "default";
  234
+					 	//$results = 3; // initially only 12 porducts will be displayed. Change 3 to 12. and sort by newest.
233 235
 						$args = array_merge( $wp_query->query, 
234 236
 							array(
235 237
 						   		'post_type' => 'post',
@@ -258,6 +260,8 @@
258 260
 			<?php if (have_posts()) : ?>
259 261
 				<?php while ( have_posts() ) : the_post(); ?>
260 262
 					
  263
+					<?php if($ribbon==1):?>
  264
+					<div><span class="ribbon-area"></span></div>
261 265
 					<div class="product-box">
262 266
 						
263 267
 						<ul class="product-list">
@@ -268,12 +272,53 @@
268 272
 							<?php } ?>
269 273
 							
270 274
 							<li class="p-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
271  
-							<li class="p-descr">description ssfksjfksj sfsfsjfkls fskjfksj skfjskjfks</li>
272  
-							<li class="p-price"><?php echo get_post_meta($post->ID, "prod_price", true); ?></li>
  275
+							<li class="p-descr"><?php echo get_post_meta($post->ID, "prod_desc", true); ?></li>
  276
+							<li class="p-price"><?php echo '&#36;'.get_post_meta($post->ID, "prod_price", true).'' ?></li>
273 277
 						</ul>
274 278
 						
275 279
 					</div>
  280
+					<?php else:?>
276 281
 					
  282
+					
  283
+					<?php $ribbon_data = get_post_meta($post->ID, "prod_picks", true); ?>
  284
+					<?php if($ribbon_data=='Y'){?>
  285
+					
  286
+					<!-- <div><span class="ribbon-area"></span></div> -->
  287
+					<div class="product-box">
  288
+
  289
+						<div><span class="ribbon-area-one"></span></div>				
  290
+						<ul class="product-list">
  291
+							<?php if(has_post_thumbnail() ) { ?>
  292
+								<a href="<?php the_permalink();?>" title=""><?php the_post_thumbnail('product-thumbnail'); ?></a>
  293
+							<?php }else{ ?>
  294
+							<img src="<?php bloginfo('template_url');?>/images/no-image.jpg" width="150" height="150" alt="no-image">
  295
+							<?php } ?>
  296
+							
  297
+							<li class="p-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
  298
+							<li class="p-descr"><?php echo get_post_meta($post->ID, "prod_desc", true); ?></li>
  299
+							<li class="p-price"><?php echo '&#36;'.get_post_meta($post->ID, "prod_price", true).'' ?></li>
  300
+						</ul>
  301
+						
  302
+					</div>
  303
+					<?php } else { ?>
  304
+							
  305
+					<div class="product-box">					
  306
+						<ul class="product-list">
  307
+							<?php if(has_post_thumbnail() ) { ?>
  308
+								<a href="<?php the_permalink();?>" title=""><?php the_post_thumbnail('product-thumbnail'); ?></a>
  309
+							<?php }else{ ?>
  310
+							<img src="<?php bloginfo('template_url');?>/images/no-image.jpg" width="150" height="150" alt="no-image">
  311
+							<?php } ?>
  312
+							
  313
+							<li class="p-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
  314
+							<li class="p-descr"><?php echo get_post_meta($post->ID, "prod_desc", true); ?></li>
  315
+							<li class="p-price"><?php echo '&#36;'.get_post_meta($post->ID, "prod_price", true).'' ?></li>
  316
+						</ul>
  317
+						
  318
+					</div>
  319
+										
  320
+					<?php };?>
  321
+				<?php endif;?>
277 322
 				
278 323
 				
279 324
 	
BIN  images/next.png
BIN  images/prev.png
4  inc/pagination.php
@@ -11,8 +11,8 @@
11 11
 	'current' => $currentpage,
12 12
 	'show_all' => false,
13 13
 	'type' => 'plain',
14  
-	'prev_text'    => __('&#171;', 'domain-themefit-hybrid'),
15  
-    'next_text'    => __('&#187;', 'domain-themefit-hybrid')
  14
+	'prev_text'    => __('&nbsp;&nbsp;&nbsp;&nbsp;', 'domain-themefit-hybrid'),
  15
+    'next_text'    => __('&nbsp;&nbsp;&nbsp;&nbsp;', 'domain-themefit-hybrid')
16 16
 	);
17 17
 
18 18
 if( $wp_rewrite->using_permalinks() )
14  meta-box/functions.php
@@ -22,6 +22,7 @@ function prod_details_meta($object, $box){
22 22
 
23 23
 	global $post;
24 24
 	$custom = get_post_custom($post->ID);
  25
+	$prod_desc = $custom["prod_desc"][0];
25 26
   	$prod_price = $custom["prod_price"][0];
26 27
   	$prod_picks = $custom["prod_picks"][0];
27 28
   	$prod_popularity = $custom["prod_popularity"][0];
@@ -29,16 +30,23 @@ function prod_details_meta($object, $box){
29 30
 
30 31
 	<div id="prod_details">
31 32
 		<p>
  33
+			<label class="lbl_1" for ="upcoming_details_meta"><strong>Short descriptions</strong></label>
  34
+  			<input name="prod_desc" id="up-date" value= "<?php echo $prod_desc ?>" size="30" type="textfield">
  35
+  			<p class="description">Enter few words</p>
  36
+  		</p>
  37
+		<p>
32 38
 			<label class="lbl_1" for ="upcoming_details_meta"><strong>Price</strong></label>
33 39
   			<input name="prod_price" id="up-date" value= "<?php echo $prod_price ?>" size="10" type="textfield">
  40
+  			<p class="description">Enter price (No need to add currency symbol here)</p>
34 41
   		</p>
35 42
   		<p>
36 43
 			<label class="lbl_1" for ="upcoming_details_meta"><strong>Top Picks</strong></label>
37  
-  			<input name="prod_picks" id="up-date" value= "<?php echo $prod_picks ?>" size="10" type="textfield">
  44
+  			<input name="prod_picks" id="up-date" value= "<?php echo $prod_picks ?>" size="5" type="textfield">
  45
+  			<p class="description">Enter Y or N </p>
38 46
   		</p>
39 47
   		<p>
40 48
 			<label class="lbl_1" for ="upcoming_details_meta"><strong>Popularity</strong></label>
41  
-  			<input name="prod_popularity" id="up-date" value= "<?php echo $prod_popularity ?>" size="10" type="textfield">
  49
+  			<input name="prod_popularity" id="up-date" value= "<?php echo $prod_popularity ?>" size="5" type="textfield">
42 50
   			<p class="description">Enter Popularity (between 1 and 10 (where 1 is less popular , 10 is hot))</p>
43 51
   		</p>
44 52
 	
@@ -50,7 +58,7 @@ function save_details_post(){
50 58
     return $post_id;
51 59
     
52 60
     global $post;
53  
-    
  61
+    update_post_meta($post->ID, "prod_desc", $_POST["prod_desc"]);
54 62
     update_post_meta($post->ID, "prod_price", $_POST["prod_price"]);
55 63
 	update_post_meta($post->ID, "prod_picks", $_POST["prod_picks"]);
56 64
 	update_post_meta($post->ID, "prod_popularity", $_POST["prod_popularity"]);
20  style.css
@@ -450,19 +450,27 @@ h1.cat-h1{font-size: 34px; line-height: 1; margin: 0;}
450 450
 #sort, #showresults{width: 150px; /* height: 25px; border: 0; */ }
451 451
 
452 452
 
  453
+.prev{background: url(images/prev.png)no-repeat 0 0; width: 17px; height: 17px;}
  454
+.next{background: url(images/next.png)no-repeat 0 0; width: 17px; height: 17px;}
  455
+.page-numbers{color: #6699cc; font-size: 15px; font-weight: bold;}
  456
+span.current{color: #666666; font-size: 15px; font-weight: bold;}
453 457
 
  458
+.total-gifts{color:#6699cc;font-size: 15px; font-weight: bold;}
454 459
 
  460
+/*Product gallery*/
  461
+.product-box{float: left; width: 160px; min-height: 230px; border: 1px solid #CCC; margin-right: 10px;margin-bottom: 10px;}
  462
+.right-col .product-box:nth-child(4n+4){margin-right: 0; }
  463
+/* ul.product-list li{margin: 5px;} */
  464
+ul.product-list img{margin: 5px;}
455 465
 
  466
+/*Ribbon products*/
  467
+span.ribbon-area{background: url(images/top-pick.png) no-repeat 0 0; width: 61px; height: 62px; position: absolute; margin: -4px;}
  468
+span.ribbon-area-one{background: url(images/top-pick.png) no-repeat 0 0; width: 61px; height: 62px; position: absolute; z-index: 1; margin: -4px;}
456 469
 
457 470
 
458 471
 
459  
-/*Product gallery*/
460  
-.product-box{float: left; width: 160px; min-height: 230px; border: 1px solid #CCC; margin-right: 10px;margin-bottom: 10px;}
461  
-.product-box:nth-child(4n+6){margin-right: 0; }
462  
-/* ul.product-list{margin: 5px;} */
463  
-
464 472
 .p-title, .p-descr, .p-price{text-align: center;}
465  
-.p-title, .p-descr{color: #919191; font-size: 14px; }
  473
+.p-title a, .p-descr{color: #919191; font-size: 14px; }
466 474
 .p-price{color: #CC3399; font-size: 18px; font-weight: bold;}
467 475
 
468 476
 

0 notes on commit 63c476a

Please sign in to comment.
Something went wrong with that request. Please try again.