-
Search Results
-
I’ve a results.php with
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2014 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ /* ROSS DEV CODE START */ //var_dump($query->posts); /* $i = 1; foreach($query->posts as $tpost) { echo $i." | ".$tpost->post_title; echo "<br />"; $i++; } echo "<hr />"; $i = 1; while ($query->have_posts()) { $query->the_post(); echo $i." | "; the_title(); echo "<br />"; $i++; } /* ROSS DEV CODE END */ if ( $query->have_posts() ) { ?> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="filter-results" > <div class="filter-results-page"><?php echo $query->found_posts; ?> Ergebnisse Seite <?php echo $query->query['paged']; ?> von <?php echo $query->max_num_pages; ?></div> <div class="filter-results-pagination"> <?php sf_pagination_prev_next($query->query['paged'], $query->max_num_pages); ?> <?php sf_pagination_numbers($query->query['paged'], $query->max_num_pages, " "); ?> </div> </div> </div> </div> <div class="row"> <?php while ($query->have_posts()) { $query->the_post(); $post_type = get_post_type( get_the_ID() ); ?> <?php switch ($post_type) { case 'wein': echo '<div class="col-xs-12 col-sm-4 col-md-3 col-lg-3">'; echo '<div class="item-'.$post_type.'">'; $wine_id = get_the_ID(); $term_list = wp_get_post_terms($wine_id, 'winzer', array("fields" => "names")); $title = get_the_title(); $permalink = get_permalink(); $stock = get_field('wine-stock'); $stock_text = get_field('wine-stock-text'); if (empty($stock_text)) { $stock_text = "Ausverkauft!"; } if (!empty($stock)) { echo '<div class="wine-teaser"> <span></span><p>'.$stock_text.'</p></div>'; } $name = get_field('wine-name'); $img_url = get_field('wine-detail-image'); if (empty($img_url)) { $img_url = '/wordpress/wp-content/uploads/wine_empty.png'; } $year = get_field('wine-detail-year'); $sf = get_field('wine-detail-soul-faktor'); $size = get_field('wine-detail-size'); echo '<div class="item-overlay"><div class="overlay-content">'.$sf.'<br>Flasche'.$size.'</div></div>'; echo '<a href="'.$permalink.'" title="'.$title.'">'; //echo '<img src="'.aq_resize( $img_url, '300').'" alt="'.$title.'"></a></div>'; echo '<img src="'.aq_resize( $img_url, '300').'" alt="'.$title.'"></a></div>'; echo '<div class="wine-description"><h2><a href="'.$permalink.'" title="'.$title.'">'.$year.' '.$name.'</a></h2>'; echo '<h3>'.$term_list[0].'</h3></div>'; break; case 'winzer': $grower_id = get_the_ID(); $term_list_country = wp_get_post_terms($grower_id, 'land', array("fields" => "names")); $term_list_region = wp_get_post_terms($grower_id, 'anbaugebiet', array("fields" => "names")); $img_url = get_field('winegrower-preview-image'); $logo_url = get_field('winegrower-logo'); $title = get_the_title(); $permalink = get_permalink(); $exclusive = get_field('winegrower-exclusive'); if ($exclusive == 1) { $addexclusive = ' - Exklusiv bei Wein am Limit'; } else { $addexclusive = ''; } echo '<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">'; echo '<div class="item-'.$post_type.'">'; if (!empty($img_url)) { if (!empty($logo_url)){ echo '<div class="logo-overlay"><img src="'.aq_resize( $logo_url, '100').'"></div>';} echo '<a href="'.$permalink.'" title="'.$title.'">'; //echo '<img src="'.aq_resize( $img_url, '600', '290' , true).'" alt="'.$title.'"></a></div>'; echo '<img src="'.aq_resize( $img_url, '600', '290' , true).'" alt="'.$title.'"></a>'; } echo '</div>'; echo '<div class="grower-description"><h2><a href="'.$permalink.'" title="'.$title.'">'.$title.$addexclusive.'</a></h2>'; echo '<h3>'.$term_list_region[0].', '.$term_list_country[0].'</h3></div>'; break; } ?> </div> <?php } ?> </div> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="filter-results" > <div class="filter-results-page"><?php echo $query->found_posts; ?> Ergebnisse Seite <?php echo $query->query['paged']; ?> von <?php echo $query->max_num_pages; ?></div> <div class="filter-results-pagination"> <?php sf_pagination_prev_next($query->query['paged'], $query->max_num_pages); ?> <?php sf_pagination_numbers($query->query['paged'], $query->max_num_pages, " "); ?> </div> </div> </div> </div> <?php } else { echo '<div class="filter-results" style="height:38px;"><div class="filter-results-page"><div class="filter-results-pagination"></div></div></div>'; echo '<div style="width:100%; text-align:center;min-height:400px;padding-top:100px;">Keine Produkte gefunden.</div>'; } ?>
which is workin no more after update to S&F 2.0.3 (from 1.4.2) – I’ve rebuild all caches, the site stay just empty. Any ideas on this?
Best.
Topic: How to style taxonomy term
Hi,
I style the taxonomy by using .searchandfilter ul li{display:inline-block;} But this make the next taxonomy become inline. What do I do if I only want that terms within specific taxonomy to be inline block?
For example, I want ‘size’ to be inline block. so I put
.searchandfilter ul li.sf-field-taxonomy-size{display:inline-block !important;}But this doesn’t work because .searchandfilter ul li{display:inline-block;} overwrite it.
Topic: https://
Hi Ross,
I am creating a special “just for facebook” (on our project) page which goes in iframe and it’s shown in additional facebook tab.
Of course, facebook needs https://, which I also managed for this page. But I get a problem – after performing filtering from the dropdown, it is refreshing the results with http://.
You can try it in a browser without being logged in facebook when you check this url:
https://www.facebook.com/iAllgaeu.de/app/337680106275807/?ref=page_internal
(the results are still not styled)For this particular search, I am using shortcode method, the search form and the results shortcodes are on the same page, and it is performing the search via ajax.
What is the best way you recommend to make a custom change in the code (and where), because I need to reload the results using https:// just for this specific page (and NOT for the rest of the search pages)?
Thanks in advance!
Topic: CSS Class Conflicts
SF uses css classes that should be reserved for default WordPress styling. For example, I am loading the default Jquery accordion and tabs scripts to organize some data on my site. The page has zero search and filter functionality. But since SF uses class such as ui-widget-content or ui-corner-bottom, SF loads styling in a place that it should not. When you load the jquery scripts, it targets an ID then loads default classes to that div. They are the default for WordPress Core. SF should prefix their classes so that it does not override/conflict with WordPress Core.
I have a screenshot of Google Chrome Inspector if you want to see the code. The highlighted HTML is the default css classes loaded by the tabs jqery. And on the right hand side, you can see SF loading 2 different styles (ui-corner-bottom and ui-widget-content).
Topic: Styling of shortcode results
Hi,
I’m showing my results via shortcode. Every single result is wrapped in a div without a css-class. How can I add a css-class to these divs? Or is there any other way to style the filter results?
I studied your documentation, just some things don’t work how they would. For example, if I setup filter to be shown in WooCommerce pages, filter won’t show. The only option which will work is via shortcode, but then it looks like this http://www.vozik.sk/filter-produktov/.
The problem is that items are wrapped in divs with no classes or id, so there is no way for me to style them in CSS.
Can you help me with this problem?
What we need: we want to filter to work in WooCommerce “shop” page and also in taxonomy archives (category, tag), if possible, AND to be shown on page before products, not in sidebar.
(by the way, we first tried it on different website and the problem was the same)
Topic: Filter results in same page
Hello There,
I bought S&F yesterday and start to use it but I have a few problem that I need help.
1) how can I have filter results in same page, like your movie page? for eg. in movie page everything happen in same page. but in mine results show in new page.
2) how can I change fonts, color and style in widget?
Thanks
Kambiz