Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ribbon is added. pagination is styled.

  • Loading branch information...
commit 63c476a942433da7b703653069abc3f3882cbd99 1 parent 684a0a1
@zakirsajib authored
View
61 category.php
@@ -7,6 +7,7 @@
<div id="cat-container">
<?php if (is_category()) { global $wp_query, $sort, $results, $paged;
+$ribbon=0;
?>
<div id="cat-sidebar" class="left-sidebar">
@@ -175,7 +176,7 @@
$sort = get_option('current_sort', $sort);
$results = get_option('current_result', $results);
if($sort=='high'){
- echo "high";
+ //echo "high";
$args = array_merge( $wp_query->query,
array(
'post_type' => 'post',
@@ -188,7 +189,7 @@
query_posts($args);
}elseif($sort=='low'){
- echo "low";
+ //echo "low";
$args = array_merge( $wp_query->query,
array(
'post_type' => 'post',
@@ -201,7 +202,8 @@
query_posts($args);
}elseif($sort=='prod_picks'){
- echo "picks";
+ //echo "picks";
+ $ribbon=1;
$args = array_merge( $wp_query->query,
array(
'post_type' => 'post',
@@ -214,7 +216,7 @@
query_posts($args);
}elseif($sort=='prod_popularity'){
- echo "pop";
+ //echo "pop";
$args = array_merge( $wp_query->query,
array(
'post_type' => 'post',
@@ -228,8 +230,8 @@
}else{
- echo "default";
- $results = 3; // initially only 12 porducts will be displayed. Change 3 to 12. and sort by newest.
+ //echo "default";
+ //$results = 3; // initially only 12 porducts will be displayed. Change 3 to 12. and sort by newest.
$args = array_merge( $wp_query->query,
array(
'post_type' => 'post',
@@ -258,6 +260,8 @@
<?php if (have_posts()) : ?>
<?php while ( have_posts() ) : the_post(); ?>
+ <?php if($ribbon==1):?>
+ <div><span class="ribbon-area"></span></div>
<div class="product-box">
<ul class="product-list">
@@ -268,12 +272,53 @@
<?php } ?>
<li class="p-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
- <li class="p-descr">description ssfksjfksj sfsfsjfkls fskjfksj skfjskjfks</li>
- <li class="p-price"><?php echo get_post_meta($post->ID, "prod_price", true); ?></li>
+ <li class="p-descr"><?php echo get_post_meta($post->ID, "prod_desc", true); ?></li>
+ <li class="p-price"><?php echo '&#36;'.get_post_meta($post->ID, "prod_price", true).'' ?></li>
</ul>
</div>
+ <?php else:?>
+
+ <?php $ribbon_data = get_post_meta($post->ID, "prod_picks", true); ?>
+ <?php if($ribbon_data=='Y'){?>
+
+ <!-- <div><span class="ribbon-area"></span></div> -->
+ <div class="product-box">
+
+ <div><span class="ribbon-area-one"></span></div>
+ <ul class="product-list">
+ <?php if(has_post_thumbnail() ) { ?>
+ <a href="<?php the_permalink();?>" title=""><?php the_post_thumbnail('product-thumbnail'); ?></a>
+ <?php }else{ ?>
+ <img src="<?php bloginfo('template_url');?>/images/no-image.jpg" width="150" height="150" alt="no-image">
+ <?php } ?>
+
+ <li class="p-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
+ <li class="p-descr"><?php echo get_post_meta($post->ID, "prod_desc", true); ?></li>
+ <li class="p-price"><?php echo '&#36;'.get_post_meta($post->ID, "prod_price", true).'' ?></li>
+ </ul>
+
+ </div>
+ <?php } else { ?>
+
+ <div class="product-box">
+ <ul class="product-list">
+ <?php if(has_post_thumbnail() ) { ?>
+ <a href="<?php the_permalink();?>" title=""><?php the_post_thumbnail('product-thumbnail'); ?></a>
+ <?php }else{ ?>
+ <img src="<?php bloginfo('template_url');?>/images/no-image.jpg" width="150" height="150" alt="no-image">
+ <?php } ?>
+
+ <li class="p-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
+ <li class="p-descr"><?php echo get_post_meta($post->ID, "prod_desc", true); ?></li>
+ <li class="p-price"><?php echo '&#36;'.get_post_meta($post->ID, "prod_price", true).'' ?></li>
+ </ul>
+
+ </div>
+
+ <?php };?>
+ <?php endif;?>
View
BIN  images/next.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/prev.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 inc/pagination.php
@@ -11,8 +11,8 @@
'current' => $currentpage,
'show_all' => false,
'type' => 'plain',
- 'prev_text' => __('&#171;', 'domain-themefit-hybrid'),
- 'next_text' => __('&#187;', 'domain-themefit-hybrid')
+ 'prev_text' => __('&nbsp;&nbsp;&nbsp;&nbsp;', 'domain-themefit-hybrid'),
+ 'next_text' => __('&nbsp;&nbsp;&nbsp;&nbsp;', 'domain-themefit-hybrid')
);
if( $wp_rewrite->using_permalinks() )
View
14 meta-box/functions.php
@@ -22,6 +22,7 @@ function prod_details_meta($object, $box){
global $post;
$custom = get_post_custom($post->ID);
+ $prod_desc = $custom["prod_desc"][0];
$prod_price = $custom["prod_price"][0];
$prod_picks = $custom["prod_picks"][0];
$prod_popularity = $custom["prod_popularity"][0];
@@ -29,16 +30,23 @@ function prod_details_meta($object, $box){
<div id="prod_details">
<p>
+ <label class="lbl_1" for ="upcoming_details_meta"><strong>Short descriptions</strong></label>
+ <input name="prod_desc" id="up-date" value= "<?php echo $prod_desc ?>" size="30" type="textfield">
+ <p class="description">Enter few words</p>
+ </p>
+ <p>
<label class="lbl_1" for ="upcoming_details_meta"><strong>Price</strong></label>
<input name="prod_price" id="up-date" value= "<?php echo $prod_price ?>" size="10" type="textfield">
+ <p class="description">Enter price (No need to add currency symbol here)</p>
</p>
<p>
<label class="lbl_1" for ="upcoming_details_meta"><strong>Top Picks</strong></label>
- <input name="prod_picks" id="up-date" value= "<?php echo $prod_picks ?>" size="10" type="textfield">
+ <input name="prod_picks" id="up-date" value= "<?php echo $prod_picks ?>" size="5" type="textfield">
+ <p class="description">Enter Y or N </p>
</p>
<p>
<label class="lbl_1" for ="upcoming_details_meta"><strong>Popularity</strong></label>
- <input name="prod_popularity" id="up-date" value= "<?php echo $prod_popularity ?>" size="10" type="textfield">
+ <input name="prod_popularity" id="up-date" value= "<?php echo $prod_popularity ?>" size="5" type="textfield">
<p class="description">Enter Popularity (between 1 and 10 (where 1 is less popular , 10 is hot))</p>
</p>
@@ -50,7 +58,7 @@ function save_details_post(){
return $post_id;
global $post;
-
+ update_post_meta($post->ID, "prod_desc", $_POST["prod_desc"]);
update_post_meta($post->ID, "prod_price", $_POST["prod_price"]);
update_post_meta($post->ID, "prod_picks", $_POST["prod_picks"]);
update_post_meta($post->ID, "prod_popularity", $_POST["prod_popularity"]);
View
20 style.css
@@ -450,19 +450,27 @@ h1.cat-h1{font-size: 34px; line-height: 1; margin: 0;}
#sort, #showresults{width: 150px; /* height: 25px; border: 0; */ }
+.prev{background: url(images/prev.png)no-repeat 0 0; width: 17px; height: 17px;}
+.next{background: url(images/next.png)no-repeat 0 0; width: 17px; height: 17px;}
+.page-numbers{color: #6699cc; font-size: 15px; font-weight: bold;}
+span.current{color: #666666; font-size: 15px; font-weight: bold;}
+.total-gifts{color:#6699cc;font-size: 15px; font-weight: bold;}
+/*Product gallery*/
+.product-box{float: left; width: 160px; min-height: 230px; border: 1px solid #CCC; margin-right: 10px;margin-bottom: 10px;}
+.right-col .product-box:nth-child(4n+4){margin-right: 0; }
+/* ul.product-list li{margin: 5px;} */
+ul.product-list img{margin: 5px;}
+/*Ribbon products*/
+span.ribbon-area{background: url(images/top-pick.png) no-repeat 0 0; width: 61px; height: 62px; position: absolute; margin: -4px;}
+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;}
-/*Product gallery*/
-.product-box{float: left; width: 160px; min-height: 230px; border: 1px solid #CCC; margin-right: 10px;margin-bottom: 10px;}
-.product-box:nth-child(4n+6){margin-right: 0; }
-/* ul.product-list{margin: 5px;} */
-
.p-title, .p-descr, .p-price{text-align: center;}
-.p-title, .p-descr{color: #919191; font-size: 14px; }
+.p-title a, .p-descr{color: #919191; font-size: 14px; }
.p-price{color: #CC3399; font-size: 18px; font-weight: bold;}
Please sign in to comment.
Something went wrong with that request. Please try again.