Advertisement
Guest User

sort filter

a guest
Jan 3rd, 2012
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.88 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>
  5. <?php bloginfo('name'); ?>
  6. <?php wp_title(); ?>
  7. </title>
  8. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
  9. <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
  10. <!-- leave this for stats please -->
  11. <script type="text/javascript" src="wp-content/themes/MyWeddingReviews/js/jquery-1.2.6.min.js"></script>
  12. <script type="text/javascript" src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/js/cufon-yui.js"></script>
  13. <script type="text/javascript" src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/js/Gabrielle_400.font.js"></script>
  14. <script type="text/javascript" src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/js/Antipasto_400.font.js"></script>
  15. <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4d1ba0f222204517"></script>
  16. <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
  17. <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
  18. <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
  19. <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
  20. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  21. <?php wp_get_archives('type=monthly&format=link'); ?>
  22. <?php //comments_popup_script(); // off by default ?>
  23. <?php wp_head(); ?>
  24.  
  25.  
  26. <script type="text/javascript">
  27.  
  28. function slideSwitch() {
  29. var $active = $('#slideshow IMG.active');
  30.  
  31. if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
  32.  
  33. // use this to pull the images in the order they appear in the markup
  34. var $next = $active.next().length ? $active.next()
  35. : $('#slideshow IMG:first');
  36.  
  37. // uncomment the 3 lines below to pull the images in random order
  38.  
  39. // var $sibs = $active.siblings();
  40. // var rndNum = Math.floor(Math.random() * $sibs.length );
  41. // var $next = $( $sibs[ rndNum ] );
  42.  
  43.  
  44. $active.addClass('last-active');
  45.  
  46. $next.css({opacity: 0.0})
  47. .addClass('active')
  48. .animate({opacity: 1.0}, 1000, function() {
  49. $active.removeClass('active last-active');
  50. });
  51. }
  52.  
  53. $(function() {
  54. setInterval( "slideSwitch()", 5000 );
  55. });
  56.  
  57. </script>
  58.  
  59. <script type="text/javascript">
  60.  
  61. //Nested Side Bar Menu (Mar 20th, 09)
  62. //By Dynamic Drive: http://www.dynamicdrive.com/style/
  63.  
  64. //<![CDATA[
  65. var menuids=["sidebarmenu1"] //Enter id(s) of each Side Bar Menu's main UL, separated by commas
  66.  
  67. function initsidebarmenu(){
  68. for (var i=0; i<menuids.length; i++){
  69. var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
  70. for (var t=0; t<ultags.length; t++){
  71. ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
  72. if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
  73. ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
  74. else //else if this is a sub level submenu (ul)
  75. ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
  76. ultags[t].parentNode.onmouseover=function(){
  77. this.getElementsByTagName("ul")[0].style.display="block"
  78. }
  79. ultags[t].parentNode.onmouseout=function(){
  80. this.getElementsByTagName("ul")[0].style.display="none"
  81. }
  82. }
  83. for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
  84. ultags[t].style.visibility="visible"
  85. ultags[t].style.display="none"
  86. }
  87. }
  88. }
  89.  
  90. if (window.addEventListener)
  91. window.addEventListener("load", initsidebarmenu, false)
  92. else if (window.attachEvent)
  93. window.attachEvent("onload", initsidebarmenu)
  94. //]]>
  95. </script>
  96.  
  97. <script type="text/javascript">
  98. //Tab Titles
  99. Cufon.replace('.cufonh2', { fontFamily: 'Gabrielle' });
  100. //Sidebar Titles
  101. Cufon.replace('h2.widgettitle', { fontFamily: 'Antipasto' });
  102. </script>
  103.  
  104. <?php get_header(); ?>
  105. </head>
  106.  
  107. <body>
  108. <div id="wraper">
  109.  
  110.  
  111. <div id="spacer">
  112. <div class="quickselect">
  113. <form name="jump">
  114. <select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
  115. <option value="" class="jumpselect">- Wedding Directory Quick Select -</option>
  116. <optgroup label="Popular Categories">
  117. <option value="http://www.myweddingreviews.co.uk/photographers">Wedding Photographers</option>
  118. <option value="http://www.myweddingreviews.co.uk/wedding-cakes/wedding-cakes-wedding-cakes">Wedding Cakes</option>
  119. <option value="http://www.myweddingreviews.co.uk/video">Wedding Production</option>
  120. <option value="http://www.myweddingreviews.co.uk/transportation/classic-wedding-cars">Classic Cars</option>
  121. <option value="http://www.myweddingreviews.co.uk/transportation/luxury-wedding-cars">Luxury Cars</option>
  122. <option value="http://www.myweddingreviews.co.uk/health-beauty/beauty-salons">Beauty Salons</option>
  123. </optgroup>
  124. <optgroup label="Wedding Accessories">
  125. <option value="http://www.myweddingreviews.co.uk/accessories/jewellery">Engagement Rings</option>
  126. <option value="http://www.myweddingreviews.co.uk/accessories/fragrances">Fragrances</option>
  127. <option value="http://www.myweddingreviews.co.uk/accessories/hats">Hats</option>
  128. <option value="http://www.myweddingreviews.co.uk/accessories/jewellery">Jewellery</option>
  129. <option value="http://www.myweddingreviews.co.uk/accessories/shoes-bags">Shoes &amp; Bags</option>
  130. </optgroup>
  131.  
  132. <optgroup label="Music &amp; Entertainment">
  133. <option value="http://www.myweddingreviews.co.uk/entertainment/live-music">Live Music</option>
  134. <option value="http://www.myweddingreviews.co.uk/entertainment/djs">Wedding DJ's</option>
  135. <option value="http://www.myweddingreviews.co.uk/entertainment/creche">Wedding Creche</option>
  136. </optgroup>
  137. <optgroup label="For The Bride">
  138. <option value="http://www.myweddingreviews.co.uk/for-the-bride/bride-dresses">Bridal Dresses</option>
  139. <option value="http://www.myweddingreviews.co.uk/for-the-bride/lingerie">Bridal Lingerie</option>
  140. <option value="http://www.myweddingreviews.co.uk/accessories/shoes-bags">Bridal Shoes</option>
  141. <option value="http://www.myweddingreviews.co.uk/for-the-bride/bridesmaid">Bridesmaids</option>
  142. <option value="http://www.myweddingreviews.co.uk/for-the-bride/mother-of-the-bride">Mother of the Bride</option>
  143. <option value="http://www.myweddingreviews.co.uk/for-the-bride/tiara">Tiaras</option>
  144. <option value="http://www.myweddingreviews.co.uk/for-the-bride/hen-party">Hen Party</option>
  145. </optgroup>
  146. <optgroup label="Health &amp; Beauty">
  147. <option value="http://www.myweddingreviews.co.uk/health-beauty/beauty-salons">Beauty Salons</option>
  148. <option value="http://www.myweddingreviews.co.uk/health-beauty/hair-makeup">Hair &amp; Makeup</option>
  149. <option value="http://www.myweddingreviews.co.uk/health-beauty/spa">Luxury Spa</option>
  150. <option value="http://www.myweddingreviews.co.uk/health-beauty/teeth-whitening">Teeth Whitening</option>
  151. <option value="http://www.myweddingreviews.co.uk/health-beauty/fitness-clubs">Fitness Clubs</option>
  152. <option value="http://www.myweddingreviews.co.uk/health-beauty/personal-trainer">Personal Trainers</option>
  153. <option value="http://www.myweddingreviews.co.uk/health-beauty/golf-clubs">Golf Clubs</option>
  154. </optgroup>
  155. <optgroup label="Fashion &amp; Style">
  156. <option value="http://www.myweddingreviews.co.uk/directory/accessories">Accessories</option>
  157. <option value="http://www.myweddingreviews.co.uk/accessories/shoes-bags">Shoes &amp; Bags</option>
  158. <option value="http://www.myweddingreviews.co.uk/fashion-and-style/clothing">Clothing</option>
  159. <option value="http://www.myweddingreviews.co.uk/health-beauty/teeth-whitening">Teeth Whitening</option>
  160. <option value="http://www.myweddingreviews.co.uk/health-beauty/fitness-clubs">Fitness Clubs</option>
  161. <option value="http://www.myweddingreviews.co.uk/accessories/fragrances">Perfumes</option>
  162. </optgroup>
  163. <optgroup label="Gift List Services">
  164. <option value="http://www.myweddingreviews.co.uk/gift-list-services/bespoke">Bespoke</option>
  165. <option value="http://www.myweddingreviews.co.uk/favours">Favours &amp; Gifts</option>
  166. <option value="http://www.myweddingreviews.co.uk/stationery-invitations">Invotations &amp; Stationery</option>
  167. <option value="http://www.myweddingreviews.co.uk/gift-list-services/luxury-goods">Luxury Goods</option>
  168. <option value="http://www.myweddingreviews.co.uk/gift-list-services/wedding-gifts">Wedding Gifts</option>
  169. </optgroup>
  170. <optgroup label="Luxury Holidays">
  171. <option value="http://www.myweddingreviews.co.uk/holiday/honeymoon">Honeymoons</option>
  172. <option value="http://www.myweddingreviews.co.uk/holiday/romantic-weekends">Romantic Weekends</option>
  173. </optgroup>
  174.  
  175. <optgroup label="For The Groom">
  176. <option value="http://www.myweddingreviews.co.uk/groom/stag-party">Stag Nights</option>
  177. <option value="http://www.myweddingreviews.co.uk/groom/fashion">Fashion</option>
  178. </optgroup>
  179. <optgroup label="Transportation">
  180. <option value="http://www.myweddingreviews.co.uk/transportation/limo">Limo Hire</option>
  181. <option value="http://www.myweddingreviews.co.uk/transportation/luxury-wedding-cars">Luxury Wedding Cars</option>
  182. <option value="http://www.myweddingreviews.co.uk/transportation/sports-cars">Sports Cars</option>
  183. <option value="http://www.myweddingreviews.co.uk/transportation/classic-wedding-cars">Classic Cars</option>
  184. </optgroup>
  185. <optgroup label="Table &amp; Venue Decorations">
  186. <option value="http://www.myweddingreviews.co.uk/table-venue-decorations/chair-covers">Chair Covers</option>
  187. <option value="http://www.myweddingreviews.co.uk/table-venue-decorations/lighting-mood-setting">Lighting &amp; Mood Setting</option>
  188. </optgroup>
  189. <optgroup label="Wedding Cakes">
  190. <option value="http://www.myweddingreviews.co.uk/wedding-cakes/wedding-cakes-wedding-cakes">Wedding Cakes</option>
  191. <option value="http://www.myweddingreviews.co.uk/wedding-cakes/chocolate-fountain">Chocolate Fountains</option>
  192. <option value="http://www.myweddingreviews.co.uk/wedding-cakes/fairy-cakes">Fairy Cakes</option>
  193. <option value="http://www.myweddingreviews.co.uk/wedding-cakes/ice-sculptures">Ice Sculptures</option>
  194. </optgroup>
  195. <optgroup label="Other">
  196. <option value="http://www.myweddingreviews.co.uk/flowers">Wedding Flowers</option>
  197. <option value="http://www.myweddingreviews.co.uk/favours">Wedding Favours</option>
  198. <option value="http://www.myweddingreviews.co.uk/hotels-venues">Hotels &amp; Venues</option>
  199. <option value="http://www.myweddingreviews.co.uk/caterers">Food &amp; Caterers</option>
  200. <option value="http://www.myweddingreviews.co.uk/wedding-planners">Designer Wedding Planners</option>
  201. <option value="http://www.myweddingreviews.co.uk/stationery-invitations">Stationery &amp; Invitations</option>
  202. </optgroup>
  203. </select>
  204. </form>
  205. </div>
  206.  
  207.  
  208. <div class="loginpopup">
  209. <?php if (is_user_logged_in()) {
  210. $user = wp_get_current_user();
  211. echo 'Welcome <strong>'.$user->display_name.'</strong> | <a href="http://www.myweddingreviews.co.uk/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fwww.myweddingreviews.co.uk%2F&_wpnonce=4d68bad222">Logout</a>';
  212. } else { ?>
  213. <a href="/wp-login.php?redirect_to=<?php echo $_SERVER['REQUEST_URI']; ?>" class="simplemodal-login">Log In</a> <strong>|</strong>
  214. <a href="/wp-login.php?action=register" class="simplemodal-register">Register</a>
  215. <?php } ?>
  216. </div>
  217.  
  218. <div style="float:right; width:160px; margin-top:8px; margin-right:-23px;">
  219. <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
  220. <a class="addthis_button_preferred_1"></a>
  221. <a class="addthis_button_preferred_2"></a>
  222. <a class="addthis_button_compact"></a>
  223. </div>
  224. </div>
  225. <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e1389f6699ee59a"></script>
  226.  
  227. </div>
  228.  
  229. <div class="slidewrapper">
  230. <div id="headerslide"> <!--width:560px; x 310px-->
  231. <img src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/images/weddingsearchslide1.jpg" width="990" height="310" alt="Wedding Directory search" />
  232. <!--<img src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/images/wedding-slide1.jpg" alt="Slideshow Image 1" class="active" />
  233. <img src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/images/header-photo3.jpg" alt="Slideshow Image 2" />
  234. <img src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/images/header-photo1.jpg" alt="Slideshow Image 3" /> -->
  235. <div class="newsfeeds">
  236. <a href="http://www.myweddingreviews.co.uk/feed/atom"><img height="16" width="16" src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/images/rss.png" alt="Wedding Directory news feed"></a>
  237. <a href="http://www.myweddingreviews.co.uk/feed/atom" title="Wedding Directory news feed">news feed</a>
  238.  
  239. <a href="http://www.myweddingreviews.co.uk/comments/feed" title="Read The Wedding Directory Reviews" class="pr">
  240. <img height="16" width="16" src="http://www.myweddingreviews.co.uk/wp-content/themes/MyWeddingReviews/images/rss.png" alt="Wedding Directory Reviews feed"></a>
  241. <a href="http://www.myweddingreviews.co.uk/comments/feed" title="Wedding Directory Reviews feed">reviews feed</a>
  242. </div>
  243. </div>
  244.  
  245.  
  246. <div id="mainsearch">
  247. <?php if(function_exists('wp_custom_fields_search'))
  248. wp_custom_fields_search('preset-4'); ?>
  249. </div>
  250. </div>
  251.  
  252. <div id="nav">
  253. <ul id="nav">
  254. <?php wp_list_pages('title_li=&depth=0&sort_column=menu_order&exclude=56'); ?>
  255. </ul>
  256. </div>
  257.  
  258. <div id="content-wrap">
  259.  
  260. <div id="main">
  261. <div style="float:right;">
  262. <label>Sort By:</label>
  263. <?php if (class_exists('WP_Smart_Sort')) { $wpss = new WP_Smart_Sort(); if (method_exists($wpss,'placesort')) { $wpss->placesort(); } } ?>
  264. </div>
  265.  
  266. <div style="float:right;">
  267. <?php
  268. $current_cat = get_query_var('cat');
  269. $tag_slugs = array();
  270. global $query_string;
  271. query_posts( $query_string);
  272.  
  273. // first loop to get all post tag (area) slugs
  274. while ( have_posts() ) {
  275. the_post();
  276. $tags = get_the_tags();
  277. if($tags) {
  278. foreach ($tags as $tag) {
  279. $tag_slugs[] = $tag->slug;
  280. }
  281. }
  282. }
  283. // remove duplicate tag slugs and sort them alphabetically
  284. $tag_slugs = array_unique($tag_slugs);
  285. sort($tag_slugs);
  286. ?>
  287.  
  288. <?php
  289. // if there are tags show the form
  290. if(!empty($tag_slugs)) :
  291. ?>
  292. <form method="get" id="tag_order">
  293. <select name="select_tag">
  294. <option value="alltags" <?php selected( $_GET['area'],'alltags', 1 ); ?> onClick='window.location = "<?php echo get_category_link( $current_cat ); ?>"' >All Areas</option>
  295. <?
  296. foreach ( $tag_slugs as $tag_slug ) {
  297.  
  298. $the_tag = get_term_by( 'slug', $tag_slug, 'post_tag' );
  299.  
  300. echo '<option value="'.$the_tag->slug.'"'.selected($_GET['area'],$the_tag->slug, 1 );
  301. echo ' onClick=\'window.location = "'.get_category_link( $current_cat ).'?area='.$the_tag->slug.'"; return false;\'>'.$the_tag->name.'</option>';
  302. }
  303. ?>
  304. </select>
  305. </form>
  306. <?php endif; ?>
  307. <?php
  308. // very important to reset the query
  309. wp_reset_query(); ?>
  310. <?php
  311. if(isset($_GET['area']) && $_GET['area']) {
  312. // an areay was selected
  313. global $query_string;
  314. query_posts( $query_string.'&tag='.$_GET['area']);
  315. }
  316. ?>
  317. </div>
  318.  
  319. <?php if(have_posts()): ?>
  320. <?php while(have_posts()): the_post(); ?>
  321. <div id="post-<?php the_ID(); ?>">
  322. <h2 class="cufonh2"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  323. <?php the_title(); ?>
  324. </a> </h2>
  325. <div class="entry">
  326. <?php remove_filter('the_content', 'wpautop'); ?>
  327. <?php the_content(''); ?>
  328. <div class="clear"></div>
  329.  
  330. <p class="postmeta">
  331. Category : <?php the_category(', ') ?>
  332. <strong>|</strong>
  333. Area : <?php the_tags(''); ?>
  334. <strong>|</strong>
  335. <?php comments_popup_link('No Reviews &raquo;', '1 Review &raquo;', '% Reviews &raquo;'); ?>
  336. </p>
  337. </div>
  338. </div>
  339. <?php endwhile; ?>
  340. <div class="navigation">
  341. <?php if(function_exists('wp_paginate')) {
  342. wp_paginate();
  343. } ?>
  344. </div>
  345. <?php else : ?>
  346. <div class="post">
  347. <!-- add in custom not found for search results with no listing -->
  348. <h2>
  349. <?php _e('Not Found'); ?>
  350. </h2>
  351. </div>
  352. <?php endif; ?>
  353. </div>
  354. <?php get_sidebar(); ?>
  355. </div>
  356. <div id="footer-wrap">
  357. <?php get_footer(); ?>
  358. </div>
  359. </div>
  360. </body>
  361. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement