Search Results for 'the_field'

Forums › Forums › Search › Search Results for 'the_field'

Viewing 10 results – 11 through 20 (of 85 total)
  • Author
    Search Results
  • #233987

    Anonymous
    Inactive

    Hello,

    I have a custom archive page that I’ve setup names test-search.php. When I run a search, I am taken to the template page and see my results, however I’m unable to get the Search Term/Query Term to display on the Template. It shows in the title bar of the page as Search Results for “” Additionally, I have a Breadcrumbs Bar that should show the page_title and it just shows as blank or it displays the first search results page name instead of the actual search term.

    My Code is below:

    <?php get_header(); ?>
    <?php
    $falcons_option_data =get_option('falcons_option_data'); 
    wp_enqueue_style('iv_directories-style-110', falcons_CSS . 'listing_style_1.css');
    wp_enqueue_style('single-cpt1-style-2', falcons_CSS.'single-cpt1.css', array(), $ver = false, $media = 'all');
    ?>
    
    	
    	 <?php
    		$top_breadcrumb_image= falcons_IMAGE."banner-breadcrumb.jpg";
            if(isset($falcons_option_data['falcons-banner-breadcrumb']['url']) AND $falcons_option_data['falcons-banner-breadcrumb']['url']!=""):
    			$top_breadcrumb_image=esc_url($falcons_option_data['falcons-banner-breadcrumb']['url']);
             endif;
             
             $falcons_breadcrumb_value='1';
             if(isset($falcons_option_data['falcons-breadcrumb']) AND $falcons_option_data['falcons-breadcrumb']!=""):
    			$falcons_breadcrumb_value=$falcons_option_data['falcons-breadcrumb'];
             endif;
             
             
             if($falcons_breadcrumb_value=='1'){ 
    		?>
    		 <div class="breadcrumb-content">
    			<img   src="<?php echo $top_breadcrumb_image;?>" alt="<?php esc_html_e( 'banner', 'falcons' ); ?>">
    			<div class="container">
    				<h3> <?php
    					 the_title();
    					?></h3>
    				<h4 class="citystate"><?php the_field('city'); ?>, <?php the_field('country'); ?>	</h4>			
    			</div>
    		</div>	
    		<?php
    			}
    		?>	
    
    <div class=" ">
    	
    
    <div class="searchfilterform">
    <?php  echo do_shortcode('[searchandfilter slug="testing"]'); ?>
    </div>
    
    <div class="blog-content ">
    <div class="container">
    <div class="row">
    	  <?php
    
    $wp_iv_directories_URLPATH=wp_iv_directories_URLPATH;
    
    wp_enqueue_style('iv_directories-style-71', wp_iv_directories_URLPATH . 'assets/cube/css/cubeportfolio.css');
    wp_enqueue_style('single-cpt1-style84', falcons_CSS.'single-cpt1.css', array(), $ver = false, $media = 'all');
    	?>
    	
    <div class="col-md-12">
    <?php if(have_posts()) : ?>
    <?php $args = array( 'post_type' => 'providers', 'posts_per_page' => 10); $args['search_filter_id'] = 1902;
    $loop = new WP_Query( $args ); 
     while ( $loop->have_posts() ) : $loop->the_post(); ?>
    	
    <div class="col-sm-4 cbp-item"><div class="cbp-item-wrapper"><div class="cbp-caption-defaultWrap">
    <div class="image-container">
     <?php if ( has_post_thumbnail() ) {
    $image_id =  get_post_thumbnail_id( get_the_ID() );
    $large_image = wp_get_attachment_url( $image_id ,'full'); 
    $resize = falcons_aq_resize( $large_image, true );
    ?>
    <a href="<?php the_permalink(); ?>"> <img src="<?php echo esc_url($resize); ?>" alt="<?php esc_html_e( 'image', 'falcons' ); ?>"></a>
    </div>
    <?php } ?>
    </div>
    <div class="cbp-caption"> 
    <h5><a class="cbp-l-grid-team-name"  href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>		
    <?php if (get_post_meta($id,'city','country')) { ?>
    <?php echo get_post_meta($id,'city',true);?>, <?php echo get_post_meta($id,'country',true);?>
    <?php } ?>				
    </div></div></div>
    <?php endwhile; else : ?>
    
    <h2><?php esc_html_e('Sorry, No Providers Found', 'falcons'); ?></h2> 
    <?php endif; ?>
    	</article>
    <?php if(function_exists('wp_pagination')) wp_pagination(); ?>
    <?php //wp_pagination(); ?>
    	</div></div></div>
    <?php get_footer();?>

    Anonymous
    Inactive

    Hi,
    I’ve searched as long as possible in the forum.
    I’ve read the documentation.

    The ajax form search fields and reset, works well.
    But I can’t get infinite scrolls to work.

    I’ve tryed with shortcode. I’ve put the shortcode in the WP classic editor. I’ve copied results.php in a subfolder of my theme (that is elementor hello theme) and I pasted in, the code of the results-infinite-scroll.php template.
    In the settings the result url is filled etc etc.
    Nothing. Scrolling nothing happens.

    Then I’ve tryed with custom setting. I’ve set a custom template in my theme with the code of the results-infinite-scroll.php template customized.
    In the settings the result url is filled etc etc.
    Ajax container = #main
    Pagination Type is set to infinite scroll; show loading icon checkbox is checked, but it’s not loaded.
    Post result selector = .search-results-item (but I’ve tryed without it, too)
    Infinite Scroll Container: = empty (but I’ve tryed with #search-filter-results-list, too)
    I’ve tryed all the other fields of the Ajax Pagination setting section, but nothing.
    I’ve deactivated all plugin except ACF Pro, Custom post type UI and S&F Pro of course. Nothing
    I’ve changed the theme with a default one. Nothing.

    The page is on a live web site that I’m developing. I can give the url but not publicly

    Thanks in advance for your help

    My custom template code:

    <?php
    /*
    Template Name: Eventi
    */
    get_header(); 
    ?>
    <style>
    .content {
        width:1440px;
        margin:0 auto;
        padding:20px;
    }
    .search-results-wrapper {
        display:flex;
        flex-wrap: wrap;
    }
    .search-results-item {
      /*flex: 1 0 21%;*/
      padding: 20px;
      display: flex;
      flex-direction: column;
      flex-basis: 25%;
    }
    .content-wrapper {
      flex: 1;
    }
    .post-thumb {
        height:300px;
        width:100%;
        background-position:center;
        background-size:cover;
        border-radius: 0 80px 40px 80px;
        border: 1px solid #15255E;
    }
    .post-thumb .term {
        display:inline-block;
        padding:5px 20px;
        background-color:#ccc;
        color:#FFF;
        min-width:200px;
        text-align:center;
        font-size: 20px;
        font-weight: 500;
    }
    .post-content {
        display:none;
        font-size:1rem;
      color:#010326;
      padding-top:20px;
      width:100%;
    }
    .post-title {
        color: #009cd3;
        font-size: 28px;
        margin-top:30px;
    }
    .post-event-date,
    .post-event-place {
        font-size: 16px;
        font-weight: 400;
        color: #009cd3;
    }
    
    .search-results-wrapper .btn-wrapper {
        margin-top:30px;
    }
    .search-results-wrapper .toggle_btn {
        width:100px;
    }
    .search-results-wrapper .btn-hover-last {
        width:75px;
    }
    .search-results-wrapper .btn-hover-first {
        margin-right:40px;
    }
    .search-results-wrapper .btn-hover-wrapper {
      text-align:left;  
      position:relative;
      padding-right:20px;
      display:inline-block;
    }
    
    .search-results-wrapper .toggle-wrapper:after {
      content:"\f067";
      font-size: 16px;
      top: 0px;
      right: 0px;
      position: absolute;
      -webkit-transition: all .5s ease-out;
      -moz-transition: all .5s ease-out;
      -o-transition: all .5s ease-out;
      transition: all .5s ease-out;
      display: inline-block;
      font-style: normal;
      font-variant: normal;
      text-rendering: auto;
      -webkit-font-smoothing: antialiased;
      font-family: 'FontAwesome';
      color:#15255e;
    }
    .search-results-wrapper .toggle-wrapper.active:after {
      transform: rotate(-180deg);
      content:"\f068";
      color:#009ad2;
    }
    .search-results-wrapper .btn-hover-wrapper a
    {
      display:block;
      position:relative;
      cursor:pointer;
    }
    .search-results-wrapper .btn-hover-wrapper img
    {
       transition: opacity .25s ease-in-out;
       -moz-transition: opacity .25s ease-in-out;
       -webkit-transition: opacity .25s ease-in-out;
    }
    .search-results-wrapper .btn-hover-last {
        padding:0;
    }
    .search-results-wrapper .btn-hover-last a {
      transform: translateY(-3px);
    }
    .search-results-wrapper .btn-hover-wrapper .hover-image
    {
      position:absolute;
      top:0px;
      left:0px;
      opacity:0;
       transition: opacity .25s ease-in-out;
       -moz-transition: opacity .25s ease-in-out;
       -webkit-transition: opacity .25s ease-in-out;
    }
    
    .search-results-wrapper .btn-hover-wrapper:hover img
    {
     opacity:0; 
    }
    
    .search-results-wrapper .btn-hover-wrapper:hover .hover-image
    {
     opacity:1; 
    }
    
    </style>
    
    	
    	<div class="content">
    	
    		<div class="inner-content">
    
    			<main class="main" role="main" id="main">
    			    
    				
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
                        <article id="post-<?php the_ID(); ?>" <?php post_class(''); ?> role="article" itemscope itemtype="http://schema.org/WebPage">
                        						
                        	<header class="article-header"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                        		<h1 class="page-title"><?php the_title(); ?></h1>
                            </header> <!-- end article header -->
    
                            <section class="entry-content" itemprop="text">
                        	    <?php the_content(); ?>
                        	</section> <!-- end article section -->
                        
                        </article> <!-- end article -->
                        
                     <?php endwhile; endif; ?>
                     
                    <?php wp_reset_query(); ?>
    
                     
                        
                	<div>
                		<?php echo do_shortcode('[searchandfilter id="1675"]'); ?>
                	</div>
    
                        <?php
                        
                        $args = array('post_type' => 'eventi');
                        $args['search_filter_id'] = 1675;
                        $query = new WP_Query($args);
                        
                        if ( $query->have_posts() ) {
                        ?>
                        
                        Found <?php echo $query->found_posts; ?> Results<br />
                        
                        	<div class="search-results-wrapper" id="search-filter-results-list">
                            	<?php
                            	while ($query->have_posts())
                            	{
                            		$query->the_post();
                            		$content = get_the_content();
                            		?>
                            		<div class="search-results-item search-filter-result-item">
                            			
                            			<div class="content-wrapper">
                                		    <?php 
                                				if ( has_post_thumbnail() ) :
                                				    $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'medium-large'); 
                                		    ?>
                                				<div class="post-thumb" style="background-image:url(<?=$featured_img_url ?>)">
                                				    <?php 
                                                        $terms = get_the_terms( $post->ID, 'tipologia' ); 
                                                        foreach($terms as $term) :
                                                    ?>
                                                            <span class='term' style="background-color:<?php the_field('tax_tipologia_color', 'tipologia' . '_' . $term->term_id) ?>">
                                                              <?php echo $term->name; ?>
                                                            </span>
                                                    <?php
                                                        endforeach;
                                                    ?>
                                				</div>
                                			<?php 
                                			    endif;
                                			?>
                                			<h2 class="post-title"><?php the_title(); ?></h2>
                                			<div class="post-event-date">
                                			    <span class="from-date"><?php the_field("start_date"); ?></span>
                                			    <?php 
                                			        if ( get_field("end_date") ) :
                            		            ?>
                                			            <span class="to-date"> - <?php the_field("end_date"); ?></span>
                                			    <?php       
                                			        endif;
                                			    ?>
                                			</div>
                                			<div class="post-event-place"><?php the_field("luogo"); ?></div>
                                        </div>
                                        
                                        <div class="btn-wrapper">
                                            <div class="btn-hover-wrapper toggle-wrapper btn-hover-first">
                                              <a class="toggle_btn" data-id="post-<?php the_ID(); ?>">  
                                                <img src="https://supernovae.kreas.it/wp/wp-content/uploads/2019/12/Scopri-di-piu-2.png" alt="Scopri di piu">
                                                <img src="https://supernovae.kreas.it/wp/wp-content/uploads/2019/12/Scopri-di-piu_over.png" class="hover-image" alt="Scopri di piu over">
                                              </a>
                                            </div>
                                            <div class="btn-hover-wrapper btn-hover-last">
                                              <a href="<?php the_field("event_url"); ?>" target="_blank" title="Scopri di piu">
                                                <img src="https://supernovae.kreas.it/wp/wp-content/uploads/2019/11/vai-al-sito-e1575911625135.png" alt="Vai al sito">
                                                <img src="https://supernovae.kreas.it/wp/wp-content/uploads/2019/11/vai-al-sito-over-e1575911641927.png" class="hover-image" alt="Vai al sito">  
                                              </a>
                                            </div>
                                            <div class="post-content toggle-content" id="post-<?php the_ID(); ?>">
                                                <?=$content ?>
                                            </div>
                                        </div>
                                        
                            		</div>
                            		
                        		<?php
                            	}
                            	?>
                        	</div>
                        <?php
                        }
                        else
                        {
                        	?>
                        	<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
                        		<span>Non sono stati trovati eventi</span>
                        	</div>
                        	<?php
                        }
                        ?>
    				
    			    					
    			</main> <!-- end #main -->
    			
    			
    
    			
    
    		</div> <!-- end #inner-content -->
    
    	</div> <!-- end #content -->
    
    <script>
    jQuery(document).on('click', ".toggle_btn", function(event){
        var post_id = jQuery(this).attr("data-id");
        jQuery(this).parent().toggleClass('active');
        jQuery("#" + post_id).toggle(500);
        event.preventDefault();
    });    
    </script>
    <?php get_footer(); ?>

    Trevor
    Participant

    I have looked at the file and indeed the structure of the HTMl is that of a non-infinite scroll results.php file.

    It will need to be modified/edited to be usuable for infinite scroll.

    If you look in the plugin folder, there is a templates sub folder with examples of normal pagination and infinite scroll, to help you re-code it.

    For me it might look like this instead?

     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      https://searchandfilter.com
     * @copyright 2018 Search & Filter
     *
     * 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 - think
     * of it as a template part
     *
     * 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
     *
     */
     
    if ( $query->have_posts() )
    {
        ?>
         
        <!-- ***********************************************************************************************************
        products
        ************************************************************************************************************* -->
        <div class="found">Found <?php echo $query->found_posts; ?> Results<br /></div>
         
        <div class="search-filter-results-list products-list-area">
            <?php
            while ($query->have_posts())
            {
                $query->the_post();
                 
                ?>
     
                <div class="search-filter-result-item products-list-item w_addt_image">
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
     
                        <!-- 1st image from gallery on hover -->
                        <?php $addt_image = get_field('nr_additional_images'); if( $addt_image ): ?>
                        <div class="products-list-item-img-wrap addt_image">
                            <img src="<?php echo $addt_image[0]["sizes"]["large"]; ?>">
                        </div>
                        <?php else: ?>
                        <div class="products-list-item-img-wrap addt_image">
                            <?php the_post_thumbnail(); ?>
                        </div>
                        <?php endif; ?>
     
                        <?php $product_thumb = get_the_post_thumbnail(''); if( !empty($product_thumb) ): ?>
                        <div class="products-list-item-img-wrap">
                            <?php the_post_thumbnail(); ?>
                        </div>
                        <?php else: ?>
                        <div class="products-list-item-img-wrap">
                            <img src="http://placehold.it/300x300/e5e5e5/ffffff?text=Image+Not+Available" alt="">
                        </div>
                        <?php endif; ?>
     
                    </a>
                    <div class="details">
                        <!-- <div class="product-material-and-collection"><?php the_field('nr_material'); ?> | <?php the_field('nr_collection'); ?></div> -->
                        <div class="product-material-and-collection">
                        <?php
                            $field1 = get_field_object('nr_material');
                            $materials = get_field('nr_material'); // array of selected values
                            $resultstr = array();
                            foreach ($materials as $material) {
                                $resultstr[] = $field1['choices'][ $material ];
                            }
                            echo implode(", ",$resultstr);
                        ?>
                         |
                        <?php
                            $field = get_field_object('nr_collection');
                            $value = $field['value'];
                            $label = $field['choices'][ $value ];
                        ?>
                        <?php echo $label; ?>
     
                            <?php the_favorites_button($post_id, $site_id); ?>
                        </div>
                        <div class="product-name">
                            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                        </div>
                    </div>
                </div>
                 
                <?php
            }
            ?>
        </div>
         
        <?php
    }
    else
    {
    	?>
    	<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
    		<span>End of Results</span>
    	</div>
    	<?php
    }
    ?>
    #230647

    Anonymous
    Inactive

    This is my code, using a shortcode and a query. The display results option is Custom and using ajax.

    <?php echo do_shortcode ('[searchandfilter id="5437"]'); ?>
    
    <div class="clearfix"></div>
    <div class="filtro-cars" data-wow-duration="1s" data-wow-delay="0.3s">
    
    	<?php $args = array('post_type' => 'renting');
    	$args['search_filter_id'] = 5437;
    	$query = new WP_Query($args);?>
    
    	<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); // run the loop ?>
    	<div class="car main-car col-xs-12 col-sm-12 col-md-6 wow fadeIn no-padding" data-wow-duration="0.4s" data-wow-delay="0.3s">
    		<a class="redirectClick" href="<?php the_permalink(); ?>">
    			<div class="item item-price" >
    				<div class="car-shadow">
    					<div class="image"><?php the_post_thumbnail( 'car-related' ); ?></div>
    				    <div class="data">
    					    <div class="row">
    						    <div class="col-md-7 col-lg-8">
    						    	<span class="marca"><?php the_title (''); ?></span>
    						    	<span class="vehicle-finish"><?php the_field ('modelo'); ?></span>
    						    </div>
    						    <div class="col-md-5 col-lg-4">
    							    <div class="combustible hidden-xs hidden-sm">
    					    			<?php
    									$count = 0;
    									$your_repeater = get_field('caracteristicas');
    									if($your_repeater){
    									while( have_rows('caracteristicas') ): the_row();
    									$count++;
    									$my_field = get_sub_field('icono');
    									$my_content= get_sub_field('texto');
    									if ($count == 4) { ?>
    										<img width="14" src="<?php echo get_template_directory_uri(); ?>/inc/img/front/<?php echo $my_field; ?>.svg" /> <?php echo $my_content; ?>
    									<?php }
    									endwhile;  
    									}
    									?>
    							    </div>
    						    </div>
    					    </div>
    					    <div class="row">
    						    <div class="col-sm-7">
    							    <div class="precio-card"><?php the_field ('precio'); ?>€/mes<br>
    							    	<span class="iva-incluidos">IVA incluido</span>
    							    </div>
    						    </div>
    						    <div class="col-sm-5 info">
    							    <div class="kilometros">
    								    <?php the_field ('km_anuales'); ?><span class="km-anuales">km anuales |</span>
    								</div>
    							    <div class="meses">
    								    <?php the_field ('meses'); ?><span class="meses">meses</span>
    								</div>
    						    </div>
    					    </div>
    				    </div>
    				</div>
    			</div>
    		</a>
    	</div>
    	<?php endwhile;
    	else: ?>
    	<div class="no-results">No hemos encontrado resultados, prueba con otros criterios de filtro.</div>
    	<?php endif; ?>
     
    	<?php wp_reset_query(); ?>
    
    </div>
    #229066

    Anonymous
    Inactive

    Hello,

    I’m using the plugin in ajax and infinte scroll mode. Display method custom.
    Displays random duplicates. Other pages appear when refreshing.

    And plugin display duplicated post:
    http://i.epvpimg.com/ReXUbab.jpg

    Settings:
    http://i.epvpimg.com/pEMPbab.png

    TPL code:

    
    <?php get_header();?>
    
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="cars-stock-banner">
                    <?php 
    
                        $image = get_field('car-stock-photo');
                        $size = 'full'; // (thumbnail, medium, large, full or custom size)
                        if( $image ) {
                            echo wp_get_attachment_image( $image, $size, '', array( "class" => "lazyload" ) );
                        }
    
                    ?>
                    <div class="cars-stock-banner__content text-center">
    
                        <?php if (have_posts()): while (have_posts()) : the_post(); ?>
    
                        <?php the_content();?>
    
                        <?php endwhile; ?>
    
                        <?php endif; ?>
    
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="cars-stock-filters">
                    <!-- <div class="js-cars-stock-filters-button cars-stock-filters__button">
                        <?php _e('Filtrowanie (opcjonalnie)', 'cupra');?>
                    </div> -->
                    <div class="cars-stock-filters__form">
                        <?php echo do_shortcode('[searchandfilter id="464"]');?>
                    </div>
                </div>
            </div>
        </div>
        <?php
            $argsCars = array('post_type' => 'post');
            $argsCars['search_filter_id'] =  464;
            $queryCars = new WP_Query($argsCars);
        ?>
        <div id="cars-stock-ajax">
            <div class="cars-stock-infinite-scroll row">
                <?php if ($queryCars->have_posts()): while ($queryCars->have_posts()) : $queryCars->the_post(); ?>
                    <div class="col-12 col-sm-6 cars-stock-infinite-scroll-item">
                        <div class="row">
                            <div class="col-11">
                                <div class="cars-stock-item__img">
                                    <a href="<?php the_permalink();?>">
                                        <div class="cars-stock-item__location">
                                            <span>
                                                <?php the_field('location_car');?>
                                            </span>
                                        </div>
                                        <?php $foto = get_field('photo_1') ?>
                                        <img src="<?php echo $foto['sizes']['large'] ?>" alt="<?php the_title(); ?>" />
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-12 text-right">
                                <div class="cars-stock-item-info">
                                    <a class="cars-stock-item-info__link" href="<?php the_permalink();?>" title="<?php _e('Zobacz więcej', 'cupra');?>">
                                        <h3>
                                            <?php the_field('marka'); ?>&nbsp;<?php the_field('model'); ?>
                                        </h3>
                                    </a>
                                    <p class="cars-stock-item-info__price">
                                        <?php the_field('cena_promocyjna'); ?>
                                    </p>
                                    <p class="cars-stock-item-info__parameters">
                                        silnik: <?php the_field('pojemnosc_skokowa'); ?>&nbsp;<?php the_field('moc'); ?>
                                    </p>
                                    <p class="cars-stock-item-info__parameters">
                                        skrzynia: <?php the_field('skrzynia'); ?>
                                    </p>
                                    <a class="cars-stock-item-info__more" href="<?php the_permalink();?>" title="<?php _e('Zobacz więcej', 'cupra');?>">
                                        <?php _e('Zobacz więcej', 'cupra');?>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div> 
                <?php endwhile; 
            
                else:?>
    
                        <span data-search-filter-action='infinite-scroll-end'><?php _e('Brak więcej wyników');?></span>
    
                <?php endif; ?>
            </div>
        </div>
    </div>
    <div class="pagination">
        
    </div>
    
    <?php get_footer();?>
    

    Anyone can help me?


    Anonymous
    Inactive

    Hi There,
    I’m trying to order my results page by a number field in ACF.

    Here’s where I am at with no luck – any suggestions welcome!

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      https://searchandfilter.com
     * @copyright 2018 Search & Filter
     * 
     * 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 - think 
     * of it as a template part
     * 
     * 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
     *
     */
     
    $query = get_posts(array(
    	'meta_key'			=> 'DST-carat',
    	'orderby'			=> 'meta_value',
    	'order'				=> 'DESC'
    )); 
    
    if ( $query->have_posts() )
    {
    	?>
    
    	
    <div class="row">
        <div class="col-12">
            
            <table>
                <tbody>
                    
    
            	
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		
    		
            <tr>
                <td><?php the_field('DST-shape'); ?></td>
                <td><?php the_field('DST-carat'); ?></td>
                <td><?php the_field('DST-colour'); ?></td>
                <td><?php the_field('DST-clarity'); ?></td>
                <td><?php the_field('DST-fluorescence'); ?></td>
                <td><?php the_field('DST-lab'); ?></td>
                <td><a href="https://www.gia.edu/report-check?reportno=<?php the_field('DST-certificate'); ?>" target="_blank">GIA Certificate</a></td>
                <td>Make an enquiry</td>
            </tr>
    		
    		<?php
    	}
    	?>
    
                </tbody>
        </table>
    
    	</div>
    </div>	
    	
    	
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    	<div class="pagination">
    		
    		<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    		<?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query ) );
    			}
    		?>
    	</div>
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>
    #228131

    Anonymous
    Inactive

    Hello –
    Do you know what I’m doing wrong here?
    I’m trying to display the two below ACF custom fields in my search results, but they don’t show up. What is the correct way to display them?

    Thanks!

    name: employer Type: Relationship
    name: salary Type: Text

    <?php the_field(’employer’); ?>
    <?php the_field(‘salary’); ?>

    —-

    <?php
    /**
     * Search & Filter Pro
     *
     * Sample Results Template
     *
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      https://searchandfilter.com
     * @copyright 2018 Search & Filter
     *
     * 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 – think
     * of it as a template part
     *
     * 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
     *
     */

    if ( $query->have_posts() )
    {
    ?>

    <h5 style=”#70757a”>Found <?php echo $query->found_posts; ?> Results<br /></h5>
    Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?><br />

    <div class=”pagination”>

    <div class=”nav-previous”><?php next_posts_link( ‘Older posts’, $query->max_num_pages ); ?></div>
    <div class=”nav-next”><?php previous_posts_link( ‘Newer posts’ ); ?></div>
    <?php
    /* example code for using the wp_pagenavi plugin */
    if (function_exists(‘wp_pagenavi’))
    {
    echo “<br />”;
    wp_pagenavi( array( ‘query’ => $query ) );
    }
    ?>
    </div>

    <?php
    while ($query->have_posts())
    {
    $query->the_post();

    ?>
    <div class=”job-search-results”>
    <h2>“><?php the_title(); ?></h2>
    <?php
    if ( has_post_thumbnail() ) {
    echo ‘<p>’;
    the_post_thumbnail(“small”);
    echo ‘</p>’;
    }
    ?>        
                            <div class=”search-results-employer”><h5>Employer Name: <?php the_field(’employer’); ?> </h5></div>
                            <div class=”search-results-employer”><h5>Salary: <?php the_field(‘salary’); ?> </h5></div>
                            <div class=”search-results-location”><h5><?php the_terms( 0, ‘city’); ?>, <?php the_terms( 0, ‘job_country’); ?></h5></div>
                            <div class=”search-results-skills”><h5>Skills: <?php the_terms( 0, ‘job_expertise’); ?> </h5></div>
    <div class=”search-results-date”><h5><small><?php the_date(); ?></small></h5></div>
    </div>

    <hr />
    <?php
    }
    ?>
    Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?><br />

    <div class=”pagination”>

    <div class=”nav-previous”><?php next_posts_link( ‘Older posts’, $query->max_num_pages ); ?></div>
    <div class=”nav-next”><?php previous_posts_link( ‘Newer posts’ ); ?></div>
    <?php
    /* example code for using the wp_pagenavi plugin */
    if (function_exists(‘wp_pagenavi’))
    {
    echo “<br />”;
    wp_pagenavi( array( ‘query’ => $query ) );
    }
    ?>
    </div>
    <?php
    }
    else
    {
    echo “No Results Found”;
    }
    ?>

    #227913

    Anonymous
    Inactive

    Hi there I opened a ticket closed with success https://support.searchandfilter.com/forums/topic/search-results-on-home-page/page/2/#post-224056

    But I found that when I filter with no results there is no message of No Results.

    The Code:

    <?php	
    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(2611)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo ''; 
    } else { ?>
    
    <?php $args = array('post_type' => 'renting');
    $args['search_filter_id'] = 2611;
    $query = new WP_Query($args);?>
    	<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); // run the loop ?>
    
    <div class="car col-sm-6 col-md-4 wow fadeIn" data-wow-duration="1s" data-wow-delay="0.3s">
    		<a class="redirectClick" href="<?php the_permalink(); ?>">
    			<div class="item item-price" >
    			    <span class="marca"><?php the_title (''); ?></span>
    			    <span class="vehicle-finish"><?php the_field ('modelo'); ?></span>
    			    <div class="image"><img src="<?php the_post_thumbnail_url( $size ); ?>" /></div>
    			    <span class="precio categoria"><?php the_field ('precio'); ?><span class="euros-al-mes">€/mes</span><span class="iva-incluido">IVA incluido</span></span>
    			    <div class="price-canceled"></div>
    			    <div class="row categorias">
    				    <div class="col-xs-7 kilometros categoria"><img class="icono-kilometros" src="/wp-content/uploads/2019/04/icon-kilometer.svg" alt=""><?php the_field ('km_anuales'); ?><span class="km-anuales">km anuales</span></div>
    				    <div class="col-xs-5 meses categoria"><img class="icono-meses" src="/wp-content/uploads/2019/04/icon-clock.svg" alt=""><?php the_field ('meses'); ?><span class="meses">meses</span></div>
    			    </div>
    			</div>
    		</a>
    	</div>
    
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
    

    I need the filter to show no results until I press the search button, and if there are no results to show a “no results phrase”

    Thanks
    Any ideas?

    #226945

    In reply to: Infinite Scroll


    Anonymous
    Inactive

    Hi Trevor,

    Apologies I’ve only just gotten around to trying this out, at the minute I get both messages coming up and I’m not entirely sure why, this is my results.php file.

    <?php
    /**
    * Search & Filter Pro
    *
    * Sample Results Template
    *
    * @package Search_Filter
    * @author Ross Morsali
    * @link https://searchandfilter.com
    * @copyright 2018 Search & Filter
    *
    * 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 – think
    * of it as a template part
    *
    * 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
    *
    */

    if ( $query->have_posts() )
    {
    ?>
    <div class=”flex-grid” data-aos=”fade-up”>
    <?php
    while ($query->have_posts()){
    $query->the_post();
    ?>
    <div class=”RoleGridWrapper col”>
    <?php if( get_field(‘scrub_colour’) == ‘navy-blue’){ $postcolor = ‘#153F74’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘cornflower-blue’){ $postcolor = ‘#5184C4’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘mediterranean-blue’){ $postcolor = ‘#009EC7’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘ocean-blue’){ $postcolor = ‘#64BFD4’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘pale-sky-blue’){ $postcolor = ‘#97BADE’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘dark-green’){ $postcolor = ‘#00A296’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘mid-green’){ $postcolor = ‘#92CEBD’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘silver-grey’){ $postcolor = ‘#ABAAAB’; } ?>
    <div class=”roleContWrapper” style=”border-top: solid 10px <?php echo $postcolor; ?>”>
    <div class=”cardTAB”>
    <svg id=”scrubsIcon” data-name=”Layer 1″ xmlns=”http://www.w3.org/2000/svg&#8221; viewBox=”0 0 40 40″><title>Scrubs Icon</title><path style=”fill:<?php echo $postcolor; ?>;” d=”M39.6,7.22a40.13,40.13,0,0,0-13-4.12,1.11,1.11,0,0,0-1.39.72c-.43.91-.88,1.73-.92,1.8-1.72,3.28-3.54,6-4.18,6.19-.66-.16-2.48-2.63-4.25-5.63-.46-.76-.8-1.42-1.25-2.28a1.29,1.29,0,0,0-1.52-.77A37.94,37.94,0,0,0,.4,7.22a.78.78,0,0,0-.32,1L3.47,15a.79.79,0,0,0,.9.41l3.49-.87L6.78,36.11a.79.79,0,0,0,.79.83H32.43a.79.79,0,0,0,.79-.83L32.14,14.57l3.49.87a.79.79,0,0,0,.9-.41l3.39-6.78A.78.78,0,0,0,39.6,7.22Z”/></svg>
    </div>
    “>
    <h3 class=”postHeader”><?php the_title(); ?></h3>
    <div class=”postCATS”>
    <?php
    $categories = get_the_category();
    $parentCatName = get_cat_name($categories[0]->parent);
    if ( ! empty( $categories ) ) {
    ?>
    <span class=”parentCAT”><?php echo esc_html( $parentCatName ); ?></span>
    <?php
    }
    ?>
    </div>
    <p class=”postIntro”><?php the_field(‘brief_role_description’); ?></p>
    <div class=”readmoreWrapper”>
    <p class=”postreadmore” href=”<?php the_permalink(); ?>”>Learn more</p>
    </div>

    </div>
    </div>
    <?php
    }
    }else{
    //figure out which type of “no results” message to show
    $message = “noresults”;
    if(isset($query->query[‘paged’])) {
    if($query->query[‘paged’]>1){
    $message = “endofresults”;
    }
    }
    if($message==”noresults”) {
    ?>
    <div class=’search-filter-results-list’ data-search-filter-action=’infinite-scroll-end’>
    <span>No Results Found</span>
    </div>
    <?php
    } else {
    ?>
    <div class=’search-filter-results-list’ data-search-filter-action=’infinite-scroll-end’>
    <span>End of Results</span>
    </div>
    <?php
    }
    }
    ?>

    Can’t seem to see why it’s not choosing one or the other, the only way at the moment I can get it to find no results is to search for something that I know isn’t available.

    Thank you
    Scott

    #226209

    Anonymous
    Inactive

    Hi Trevor,

    Thanks for the reply.

    OK. So I’m using a custom post type called ‘journal’. I would like to filter the archive page for this. The archive-journal.php file is below.

    If it’s useful to speak with me, I’m in the UK

    Thank you very much for your time, & have a good week.

    Archive-journal.php:

    <?php get_header(); ?>
    
    <div class="container">
    
      <?php echo do_shortcode('[searchandfilter id="1928"]'); ?>
    
    <div class="journal-desktop-tables-gvs">
      <div class="row  journal-columns-gvs-row">
            <div class="col-xl-1 col-lg-3 col-md-3  d-none d-xl-block col-sm-3 col-xs-3 journal-columns-gvs-title">
      <!-- url -->
    <b>Link </b>
      </div>
    
      <div class="col-xl-3 d-none d-xl-block col-lg-6 col-md-6  col-sm-6 col-xs-6 journal-columns-gvs-title">
      <!-- title -->
      <b> Title </b>
      </div>
    
      <div class="col-xl-2 d-none d-xl-block col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs-title">
      <!-- name -->
      <b> Author </b>
      </div>
    
      <div class="col-xl-1  d-none d-xl-block journal-columns-gvs-title journal-small-screen-hide">
      <!-- volume -->
      <b> Volume</b>
      </div>
    
      <div class="col-xl-1 d-none d-xl-block journal-columns-gvs-title journal-small-screen-hide">
      <!-- part -->
        <b> Part </b>
      </div>
    
      <div class="col-xl-1  d-none d-xl-block journal-columns-gvs-title journal-small-screen-hide">
      <!-- month -->
      <b> Month </b>
      </div>
    
      <div class="col-xl-1 d-none d-xl-block  journal-columns-gvs-title journal-small-screen-hide">
      <!-- year -->
        <b> Year </b>
      </div>
    
      <div class="col-xl-2  d-none d-xl-block journal-columns-gvs-title journal-small-screen-hide">
      <!-- keywords/tags -->
      <b> Keywords/Tags </b>
      </div>
    
    </div> <!-- close row -->
    </div> <!-- close journal-desktop-tables-gvs -->
    
    <?php $c = 0; ?>
    <?php
    if ( have_posts() ) {
    	while ( have_posts() ) {
    		the_post(); $c++;
    
        $data_target_collapsable_with_hash_gvs = '#'. get_the_ID(); //data target with hash
        $data_target_collapsable_without_hash_gvs = get_the_ID();   // data id without hash
        $data_aria_labelleby_heading_gvs = 'heading' . get_the_ID(); // aria-labelledby
      //  echo  ' ID with hash:' . $data_target_collapsable_with_hash_gvs;
        //    echo  ' ID withOUT hash:' . $data_target_collapsable_without_hash_gvs;
        //    echo ' Arialabelledby:' . $data_aria_labelleby_heading_gvs;
        ?>
    
    <div class="row journal-columns-results-gvs">
    
    <div class="col-xl-1  col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs">
    <!-- url -->
    <div class="mobile-only-journal-title-gvs"> LINK </div>
    <a href="<?php echo esc_url(the_field('url_journal')); ?>">Pdf link</a>
    </div>
    
    <div class="col-xl-3 col-lg-6 col-md-6  col-sm-6 col-xs-6 journal-columns-gvs">
    <!-- title -->
    <div class="mobile-only-journal-title-gvs"> TITLE </div>
    <?php	the_title(); ?>
    </div>
    
    <div class="col-xl-2 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs">
    <!-- name -->
    <div class="mobile-only-journal-title-gvs"> AUTHOR </div>
    <?php the_field('first_name_journal'); ?>
    <?php the_field('surname_journal'); ?>
    </div>
    
    <!-- accordian start 1 -->
    <div id="accordion">
      <div class="card">
        <div class="card-header" id="heading-<?php the_ID(); ?>">
          <h5 class="mb-0">
            <button class="btn btn-link" data-toggle="collapse" data-target="#collapse-<?php the_ID(); ?>" aria-expanded="false" aria-controls="collapse-<?php the_ID(); ?>" id="collapsetbn">
             <span class="not-collapsed-gvs"> See more information - click here </span>        <span class="collapsed-gvs"> See less information </span>
            </button>
          </h5>
        </div>
    
        <div id="collapse-<?php the_ID(); ?>" class="collapse closed" aria-labelledby="heading-<?php the_ID(); ?>" data-parent="#accordion">
          <div class="card-body">
    
    <!-- accordian end 1 -->
    
    <div class="col-xl-1 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs ">
    <!-- volume -->
    <div class="mobile-only-journal-title-gvs"> VOLUME </div>
    <?php the_field('volume'); ?>
    </div>
    
    <div class="col-xl-1 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs">
    <!-- part -->
    <div class="mobile-only-journal-title-gvs"> PART </div>
    <?php the_field('part_journal'); ?>
    </div>
    
    <div class="col-xl-1 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs">
    <!-- month -->
    <div class="mobile-only-journal-title-gvs"> MONTH </div>
    <?php the_field('month_journal'); ?>
    </div>
    
    <div class="col-xl-1  col-lg-4 col-md-4 col-sm-4 col-xs-4 journal-columns-gvs">
    <!-- year -->
    <div class="mobile-only-journal-title-gvs"> YEAR </div>
    <?php the_field('year_journal'); ?>
    </div>
    
    <div class="col-xl-2  col-lg-6 col-md-6 col-sm-6 col-xs-6 journal-columns-gvs">
    <!-- keywords/tags -->
    <div class="mobile-only-journal-title-gvs"> KEYWORD TAGS </div>
    
    <div class="desktop-only-journal-content-gvs">
    <?php $post_tags = get_the_tags();
    
    if ( $post_tags ) {
        foreach( $post_tags as $tag ) {
        echo $tag->name . ', ';
        }
    } ?>
    </div>
    
    </div>
    
    <!-- accordian end 2 -->
    </div>
    </div>
    </div>
    </div> <!-- close #accordion -->
    
    <!-- accordian end 2 -->
    
      <div class="col-xl-1 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs desk-only ">
      <!-- volume -->
      <div class="mobile-only-journal-title-gvs"> VOLUME </div>
      <?php the_field('volume'); ?>
      </div>
    
      <div class="col-xl-1 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs desk-only ">
      <!-- part -->
      <div class="mobile-only-journal-title-gvs"> PART </div>
      <?php the_field('part_journal'); ?>
      </div>
    
      <div class="col-xl-1 col-lg-3 col-md-3  col-sm-3 col-xs-3 journal-columns-gvs desk-only ">
      <!-- month -->
      <div class="mobile-only-journal-title-gvs"> MONTH </div>
      <?php the_field('month_journal'); ?>
      </div>
    
      <div class="col-xl-1  col-lg-4 col-md-4 col-sm-4 col-xs-4 journal-columns-gvs desk-only ">
      <!-- year -->
      <div class="mobile-only-journal-title-gvs"> YEAR </div>
      <?php the_field('year_journal'); ?>
      </div>
    
      <div class="col-xl-2  col-lg-6 col-md-6 col-sm-6 col-xs-6 journal-columns-gvs desk-only ">
      <!-- keywords/tags -->
      <div class="mobile-only-journal-title-gvs"> KEYWORD TAGS </div>
    
      <div class="desktop-only-journal-content-gvs">
      <?php $post_tags = get_the_tags();
    
      if ( $post_tags ) {
          foreach( $post_tags as $tag ) {
          echo $tag->name . ', ';
          }
      } ?>
      </div>
    
      </div>
    
    </div> <!-- close row -->
    
      <?php } // end while
    } // end if
    ?>
    
    <!-- accordion end -->
    
    </div> <!-- close container -->
    
    <?php get_footer(); ?>
    
    
Viewing 10 results – 11 through 20 (of 85 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.