Permalink
Browse files

gift finder is sorted 80%

  • Loading branch information...
1 parent 1e09d71 commit f18ba7d4755c65230f762dfa2ba6b062023c0b49 @zakirsajib committed May 24, 2012
Showing with 555 additions and 43 deletions.
  1. BIN .DS_Store
  2. +23 −5 footer.php
  3. +35 −0 functions.php
  4. +17 −9 header.php
  5. +174 −18 home.php
  6. +121 −1 page.php
  7. BIN screenshot.png
  8. +77 −0 search.php
  9. +12 −4 single.php
  10. +60 −6 style.css
  11. +36 −0 theme-options.php
View
BIN .DS_Store
Binary file not shown.
View
@@ -2,14 +2,15 @@
<div class="footer-inner">
<div class="footer_col_1">
- <h4>About Gift Ideas & Items</h4>
+ <h4><?php echo get_option('footer_title_1'); ?></h4>
<p>
- Gift Ideas & Items website helps you find the perfect gift for your friends and relatives. Buying gifts have never been easier. You can now shop online for creative and cool gifts for your loved ones at the comfort of your home. Our gift selections will definitely bring smiles to your recipients.
+ <?php echo get_option('footer_descr_1'); ?>
</p>
</div>
- <div class="footer_col_2">
- <h4>Links</h4>
+ <!--
+<div class="footer_col_2">
+
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
@@ -18,14 +19,31 @@
<li><a href="#">Privacy Policy</a></li>
</ul>
</div>
+-->
+ <div class="footer_col_2">
+ <h4>Links</h4>
+ <?php wp_nav_menu( array(
+ 'theme_location' => 'Secondary',
+ 'menu_id' => '',
+ 'menu_class' => '',
+ 'container_id' =>'',
+ 'container_class' =>''
+ ));?>
+
+ </div>
+
<div class="footer_col_3">
<h4>Sign up our newsletter</h4>
<p>Receive updates and news on the latest gifts!</p>
- <form>
+ <!--
+<form>
<input type=text id="newsletter" placeholder="email address">
<input type="button"id="newsletter-button" value="Submit">
</form>
+-->
+
+ <?php echo do_shortcode( '[contact-form-7 id="277" title="newsletter"]' ); ?>
</div>
View
@@ -58,6 +58,7 @@ function register_my_menus() {
register_nav_menus(
array(
'Primary' => __( 'Primary Menu' ),
+ 'Secondary' => __( 'Footer Menu' )
)
);
}
@@ -104,6 +105,29 @@ function my_register_sidebars() {
'after_title' => '</h2>'
);
+ /*Page Sidebar*/
+ $page_sidebar=array(
+ 'id' => 'page_sidebar',
+ 'name' => __( 'Page Sidebar: Sponsored Links' ),
+ 'description' => __( 'This is for Sponsored Links' ),
+ 'before_widget' => '<div id="%1$s" class="widget %2$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h2 class="widget-title">',
+ 'after_title' => '</h2>'
+ );
+
+ /*Page Sidebar*/
+ $pro_sidebar=array(
+ 'id' => 'pro_sidebar',
+ 'name' => __( 'Product Sidebar: More related gifts' ),
+ 'description' => __( 'This is for More related gifts' ),
+ 'before_widget' => '<div id="%1$s" class="widget %2$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h2 class="widget-title">',
+ 'after_title' => '</h2>'
+ );
+
+
$item_google_adsense_sidebar_one=array(
'id' => 'item_google_adsense_sidebar_one',
'name' => __( '1. Google Adsense Sidebar' ),
@@ -146,6 +170,8 @@ function my_register_sidebars() {
/* Register the sidebars. */
register_sidebar( $sidebar_search );
+ register_sidebar( $page_sidebar );
+ //register_sidebar( $pro_sidebar );
register_sidebar( $category_sidebar );
register_sidebar( $item_google_adsense_sidebar_one );
register_sidebar( $item_google_adsense_sidebar_two );
@@ -272,4 +298,13 @@ function getCurrentCatID(){
}
return $cat_ID;
}
+
+function custom_excerpt_length( $length ) {
+ return 40;
+}
+add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
+function new_excerpt_more( $more ) {
+ return '...';
+}
+add_filter('excerpt_more', 'new_excerpt_more');
?>
View
@@ -2,7 +2,11 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+<?php if (is_search()) { ?>
+ <meta name="robots" content="noindex, nofollow" />
+ <?php } ?>
<title>
<?php
wp_title( '|', true, 'right' );
@@ -77,7 +81,12 @@
$j"#ui-carousel-next" )
.add( "#ui-carousel-prev" )
-
+
+ $j("#submit").click(function() {
+
+ window.location.href="<?php bloginfo('url');?>/giftfinder";
+ });
+
});
@@ -125,13 +134,12 @@
</div>
</div>
- <div class="search-bar">
- <?php if ( is_active_sidebar( 'sidebar_search' ) ) : ?>
- <?php dynamic_sidebar( 'sidebar_search' ); ?>
- <?php else: ?>
- <?php // ?>
- <?php endif;?>
- </div>
+ <div class="search-bar">
+ <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
+ <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search for gifts', 'twentyeleven' ); ?>" />
+ <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
+ </form>
+ </div>
</div>
View
192 home.php
@@ -1,7 +1,8 @@
<?php
/*Template name: Home*/
get_header();
-global $post;
+global $post, $results_rec, $results_occ, $results_price;
+
update_option('current_result', '');
update_option('current_sort', '');
?>
@@ -35,34 +36,189 @@
</div>
<div id="gift-finder">
<div class="gift-finder-form">
+ <?php
+
+ global $wpdb;
+ //Query for display all children for recipient category
+ $querystr = "SELECT $wpdb->term_taxonomy.term_id
+ FROM $wpdb->terms, $wpdb->term_taxonomy
+ WHERE $wpdb->terms.name='Recipients'
+ AND $wpdb->terms.term_id = $wpdb->term_taxonomy.parent
+ ";
+ $result_rec = $wpdb->get_results($querystr);
+
+
+ //Query for display all children for occasion category
+ $querystr = "SELECT $wpdb->term_taxonomy.term_id
+ FROM $wpdb->terms, $wpdb->term_taxonomy
+ WHERE $wpdb->terms.name='Occasions'
+ AND $wpdb->terms.term_id = $wpdb->term_taxonomy.parent
+ ";
+ $result_occasion = $wpdb->get_results($querystr);
+
+
+
+ ?>
+
- <div class="select-one">
- <select name="selectionField" class="recipient">
- <option value="CA" >Any Recipient</option>
- <option value="CO" >Men</option>
- <option value="CN" >Woman</option>
- </select>
- </div>
<div class="select-one">
- <select name="selectionField" class="occassion">
- <option value="CA" >Any Occassion</option>
- <option value="CO" >XMas</option>
- <option value="CN" >Good Friday</option>
- </select>
+ <form method="post" id="searrec" action="">
+ <select name="selectionRecipient" id="selectionRecipient" onChange="this.form.submit();">
+
+ <?php
+ $results_rec = get_option('current_recipient');
+ if(isset($_POST['selectionRecipient'])){
+ $results_rec = $_POST['selectionRecipient'];
+ update_option('current_recipient', $results_rec);
+ $results_rec = get_option('current_recipient');
+
+ }
+ ?>
+
+ <option <?php if($results_rec=='Any Recipient'){ echo 'selected="selected"';}?> value="Any Recipient" >Any Recipient</option>
+ <?php foreach($result_rec as $rec):
+ $t_id = $rec->term_id;
+ $term = get_term($t_id , 'category' );
+ $t_name = $term->name;?>
+<option <?php
+ if($results_rec==$t_name){ echo 'selected="selected"';}?>value="<?php echo $t_name;?>"><?php echo $t_name;?></option>
+ <?php endforeach;?>
+ </select>
+ <input type="hidden" id="submitrec" value="Search" />
+ </form>
</div>
+
+ <?//php echo $results_rec;?>
+
+
<div class="select-one">
- <select name="selectionField" class="price">
- <option value="CA" >Any Price</option>
- <option value="CO" >100</option>
- <option value="CN" >200</option>
+ <form method="post" id="searoccasion" action="">
+ <select name="selectionOccasion" class="occassion" onChange="this.form.submit();">
+
+ <?php
+ $results_occ = get_option('current_occasion');
+ if(isset($_POST['selectionOccasion'])){
+ $results_occ = $_POST['selectionOccasion'];
+ update_option('current_occasion', $results_occ);
+ $results_occ = get_option('current_occasion');
+ }
+ ?>
+
+ <?php if($results_rec=='Men'):?>
+
+ <?//php $results_men = $_POST['selectionOccasion'];?>
+
+ <option
+ <?php if($results_occ=='Anniversary Gifts for Men'){ echo 'selected="selected"';}?>value="Anniversary Gifts for Men">Anniversary Gifts for Men</option>
+ <option
+ <?php if($results_occ=='1st Anniversary Gifts'){ echo 'selected="selected"';}?>value="1st Anniversary Gifts">1st Anniversary Gifts</option>
+ <option
+ <?php if($results_occ=='2nd Anniversary Gifts'){ echo 'selected="selected"';}?>value="2nd Anniversary Gifts">2nd Anniversary Gifts</option>
+ <option
+ <?php if($results_occ=='Wedding Anniversary Gifts'){ echo 'selected="selected"';}?>value="Wedding Anniversary Gifts">Wedding Anniversary Gifts</option>
+ <option
+ <?php if($results_occ=='Birthday Gifts for Men'){ echo 'selected="selected"';}?>value="Birthday Gifts for Men">Birthday Gifts for Men</option>
+ <option
+ <?php if($results_occ=='30th Birthday Gifts'){ echo 'selected="selected"';}?>value="30th Birthday Gifts">30th Birthday Gifts</option>
+ <option
+ <?php if($results_occ=='40th birthday gifts'){ echo 'selected="selected"';}?>value="40th birthday gifts">40th birthday gifts</option>
+ <option
+ <?php if($results_occ=='50th Birthday Gifts'){ echo 'selected="selected"';}?>value="50th Birthday Gifts">50th Birthday Gifts</option>
+ <option
+ <?php if($results_occ=='Housewarming Gifts'){ echo 'selected="selected"';}?>value="Housewarming Gifts">Housewarming Gifts</option>
+ <option
+ <?php if($results_occ=='Retirement Gifts for Men'){ echo 'selected="selected"';}?>value="Retirement Gifts for Men">Retirement Gifts for Men</option>
+
+ <?php elseif($results_rec=='Women'):?>
+
+ <?//php $results_women = $_POST['selectionOccasion'];?>
+
+ <option
+ <?php if($results_occ=='Anniversary Gifts for Women'){ echo 'selected="selected"';}?>value="Anniversary Gifts for Women">Anniversary Gifts for Women</option>
+ <option
+ <?php if($results_occ=='1st Anniversary Gifts'){ echo 'selected="selected"';}?>value="1st Anniversary Gifts">1st Anniversary Gifts</option>
+ <option
+ <?php if($results_occ=='2nd Anniversary Gifts'){ echo 'selected="selected"';}?>value="2nd Anniversary Gifts">2nd Anniversary Gifts</option>
+ <option
+ <?php if($results_occ=='Wedding Anniversary Gifts'){ echo 'selected="selected"';}?>value="Wedding Anniversary Gifts">Wedding Anniversary Gifts</option>
+ <option
+ <?php if($results_occ=='Birthday Gifts for Women'){ echo 'selected="selected"';}?>value="Birthday Gifts for Women">Birthday Gifts for Women</option>
+ <option
+ <?php if($results_occ=='30th Birthday Gifts'){ echo 'selected="selected"';}?>value="30th Birthday Gifts">30th Birthday Gifts</option>
+ <option
+ <?php if($results_occ=='40th birthday gifts'){ echo 'selected="selected"';}?>value="40th birthday gifts">40th birthday gifts</option>
+ <option
+ <?php if($results_occ=='50th Birthday Gifts'){ echo 'selected="selected"';}?>value="50th Birthday Gifts">50th Birthday Gifts</option>
+ <option
+ <?php if($results_occ=='Housewarming Gifts'){ echo 'selected="selected"';}?>value="Housewarming Gifts">Housewarming Gifts</option>
+ <option
+ <?php if($results_occ=='Bridal Shower Gifts'){ echo 'selected="selected"';}?>value="Bridal Shower Gifts">Bridal Shower Gifts</option>
+ <option
+ <?php if($results_occ=='Retirement Gifts for Women'){ echo 'selected="selected"';}?>value="Retirement Gifts for Women">Retirement Gifts for Women</option>
+
+ <?php else:?>
+ <option <?php
+ if($results_occ=='Any Occasion'){ echo 'selected="selected"';}?> value="Any Occassion" >Any Occassion</option>
+ <?php foreach($result_occasion as $occ):
+ $t_id = $occ->term_id;
+ $term = get_term($t_id , 'category' );
+ $t_name = $term->name;?>
+ <option
+ <?php if($results_occ==$t_name){ echo 'selected="selected"';}?>value="<?php echo $t_name;?>"value="<?php echo $t_name;?>"><?php echo $t_name;?></option>
+ <?php endforeach;?>
+
+ <?php endif;?>
+
</select>
+ <input type="hidden" id="submitoccasion" value="Search" />
+ </form>
</div>
+ <?//php echo $results_occ;?>
+
+ <div class="select-one">
+ <form method="post" id="searprice" action="">
+ <select name="selectionPrice" class="price" onChange="this.form.submit();">
+
+ <?php
+ $results_price = get_option('current_price');
+ if(isset($_POST['selectionPrice'])){
+ $results_price = $_POST['selectionPrice'];
+ update_option('current_price', $results_price);
+ $results_price = get_option('current_price');
+ }
+ ?>
- <input type="submit" id="submit" value="Search" />
+ <option <?php if($results_price=='Any Price'){ echo 'selected="selected"';}?> value="Any Price" >Any Price</option>
+ <option <?php if($results_price=='50'){ echo 'selected="selected"';}?> value="50" >0-50</option>
+ <option <?php if($results_price=='100'){ echo 'selected="selected"';}?>value="100" >50-100</option>
+ <option <?php if($results_price=='150'){ echo 'selected="selected"';}?>value="150" >100-150</option>
+ <option <?php if($results_price=='200'){ echo 'selected="selected"';}?> value="200" >150-200</option>
+ <option <?php if($results_price=='250'){ echo 'selected="selected"';}?> value="250" >200-250</option>
+ <option <?php if($results_price=='300'){ echo 'selected="selected"';}?> value="300" >250-300</option>
+ <option <?php if($results_price=='350'){ echo 'selected="selected"';}?> value="350" >300-350</option>
+ <option <?php if($results_price=='400'){ echo 'selected="selected"';}?> value="400" >350-400</option>
+ <option <?php if($results_price=='450'){ echo 'selected="selected"';}?> value="450" >400-450</option>
+ <option <?php if($results_price=='500'){ echo 'selected="selected"';}?> value="500" >450-500</option>
+ </select>
+ <input type="hidden" id="submitprice" value="Search" />
+ </form>
</div>
+
+ <input type="submit" id="submit" value="Search" />
+
</div>
+
+ <?//php echo $results_rec;?>
+ <?//php echo $results_occ;?>
+ <?//php echo $results_price;?>
+
+</div>
+
+
+
+
<div style="clear:both">&nbsp;</div>
<div id="top-picks">
Oops, something went wrong.

0 comments on commit f18ba7d

Please sign in to comment.