Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 1,141 through 1,150 (of 1,224 total)
  • Author
    Search Results
  • #16521

    In reply to: Invisible Ajax results


    Anonymous
    Inactive

    Ok, managed it to work !

    For those who use Salient theme : add this to search-filter/results.php :

    <script type="text/javascript">
    
    	<![CDATA[
    	
    		$(".searchandfilter").on("sf:ajaxstart",function(){
    			console.log("ajax start");
    			$('#loader').show();
    		});
    		
    		$(".searchandfilter").on("sf:ajaxfinish",function(){
    			console.log("ajax complete");
    			$('#loader').hide();
    						
    			jQuery.getScript("PATH_TO_YOUR_THEME_DIRECTORY/salient/js/init.js", function(data, textStatus, jqxhr) {
    			   //console.log(data); //data returned
    			   //console.log(textStatus); //success
    			   //console.log(jqxhr.status); //200
    			   //console.log('script.js loaded.');
    			});
    				
    		});
    		
    	]]>
    
    </script>
    #16102

    Anonymous
    Inactive

    Using a custom template for the search results:

    <?php echo do_shortcode('[searchandfilter id="22467"]'); ?>
    
    <?php
    
        $args = array(            
          'post_type' => 'post',
          'posts_per_page' => 10
        );
    
        $query = query_posts($args);
    
    ?>
    <div id="content">
    	<ul>
    <?php while (have_posts()) : the_post(); ?>
    
    <li>
    	<?php the_title();?>
    </li>
    
    <?php endwhile;?>
    	</ul>
    </div>

    I’ve set the filter to use a specific a page template page-category-results.php

    #15849

    Anonymous
    Inactive

    OK…progress.

    So, (for me anyway), if you use shortcode method make sure that all the fields in the ‘As archive’ are empty. Only when these were empty will it use the results.php (at least in my case)

    #15841

    Anonymous
    Inactive

    OK,
    I followed the instructions here so I could modify the results.php file.

    However, it seems that the results page on the website is still not using the results.php template. I know, as I deleted all the content from the file, uploaded it to the newly-created search-filter folder and nothing changed.

    You can test out the search here gotimetrekkers.com to see

    I’m sure there’s something simple I’m doing wrong.

    Any ideas?

    #15760

    In reply to: Removing tags and date


    Anonymous
    Inactive

    Hi @summeralanisa,

    That is in the template being used for the results, most likely the stock one supplied with the plugin named ‘results.php’.

    You can modify that file, but I recommend backing it up first in case you need to revert if something goes wrong. Once you have it backed up, just remove those lines from the template, should be lines 64 & 65.

    #15756

    Anonymous
    Inactive

    Hi @bullduck,

    The easiest way to do this is to take the ‘results.php’ template file and copy it to a new file named with the ID number of your form (for example, if your form ID is 102, then name the new template file 102.php)….it should go in a folder named /search-filter which should be in your (active) Theme folder.

    Then modify that new template however you like…..S&P Pro will *automatically* use THAT template (it looks for one that matches the form ID first, before using ‘results.php’) when it displays your results.

    #15468

    Anonymous
    Inactive

    Hi!

    I´m using a search with 2 taxonomies which works nice on the main language (IT). But the same form does not work with on the english version of the page.
    In the drop-down it shows the correct count for each taxonomy term, but I always get “no results found” back.

    The posts are 1700 custom-post types and they are all duplicated to english, because all custom fields are separated for each language. e.g. date_en, date_it and the template is just echoing just the fields that correspond to the current language.

    This is my results.php

    Thanks for any advise.

    Philipp

    <?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 - 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(ICL_LANGUAGE_CODE=='it'){$found="Trovato ";$res=" risultati";$nextTXT="Pagina Seguente";$prevTXT="Pagina Precedente";$lang=1;}
    else{$found="Found ";$res=" results";$nextTXT="Next Page";$prevTXT="Previous Page";$lang=2;}
    
    if ( $query->have_posts() )
    {
    ?>
    <div id="counter">
    	 <?php echo $query->found_posts.$res; ?><br />
    
    </div>
    
    		<ul id="catalogo-results">
    
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    
    		$tit=get_post_meta(get_the_ID(), "wpcf-titolo", true);
    		$limit=50;
    		// if(strlen($tit) > $limit) {
    
    		//$regex = "/(.{1,$limit})\b/";
    		//preg_match($regex, $tit, $matches);
    		// $tit= $matches[1]."...";
    		if ($lang==1){
    
    			if (trim(get_post_meta(get_the_ID(), "wpcf-titolo_pub", true))=='') {
    				$titolo=get_post_meta(get_the_ID(), "wpcf-titolo", true);
    			}
    			else{
    				$titolo=get_post_meta(get_the_ID(), "wpcf-titolo_pub", true);
    			}
    
    			if ( (trim(get_post_meta(get_the_ID(), "wpcf-titolo_pub", true))=='')&&(trim(get_post_meta(get_the_ID(), "wpcf-titolo", true)))=='')
    			{
    				$notitle=true;
    				if (trim(get_post_meta(get_the_ID(), "wpcf-tipologia_pub", true))=='' ){ $titolo=get_post_meta(get_the_ID(), "wpcf-tipologia", true);}
    				else {$titolo=get_post_meta(get_the_ID(), "wpcf-tipologia_pub", true);}
    
    			}
    
    			//Autore IT
    
    			if (trim(get_post_meta(get_the_ID(), "wpcf-autore_pub", true))=='') {
    
    				$autore=get_post_meta(get_the_ID(), "wpcf-autore", true);
    			}
    			else{
    				$autore=get_post_meta(get_the_ID(), "wpcf-autore_pub", true);
    
    			}
    
    		}
    		else {
    			//EN
    			if (trim(get_post_meta(get_the_ID(), "wpcf-titolo_pub_en", true))=='') {
    				if (get_post_meta(get_the_ID(), "wpcf-titolo_pub", true)==''){
    
    					$titolo=get_post_meta(get_the_ID(), "wpcf-titolo", true);
    				}
    				else{
    					$titolo=get_post_meta(get_the_ID(), "wpcf-titolo_pub", true);
    
    				}
    			}
    			else{
    				$titolo=get_post_meta(get_the_ID(), "wpcf-titolo_pub_en", true);
    			}
    
    			//Autore
    
    			if (trim(get_post_meta(get_the_ID(), "wpcf-autore_pub_en", true))=='') {
    				if (get_post_meta(get_the_ID(), "wpcf-autore_pub", true)==''){
    
    					$autore=get_post_meta(get_the_ID(), "wpcf-autore", true);
    				}
    				else{
    					$autore=get_post_meta(get_the_ID(), "wpcf-autore_pub", true);
    
    				}
    			}
    			else{
    				$autore=get_post_meta(get_the_ID(), "wpcf-autore_pub_en", true);
    			}
    
    		}
    
    		$tit=$titolo;
    		$tit = (strlen($tit) > $limit) ? substr($tit,0,$limit).'...' : $tit;
    
    		//}
    ?>
    
    		<li class="box"><a href="<?php the_permalink();?>">
              		<div class="search-img">
    
                          <img src="/assets/js/loader.gif" data-original="http://www.lacarrara.it/catalogo-content/img/195x150/<?php echo get_post_meta(get_the_ID(), "wpcf-immagine", true);?>" class="search-img lazy" />
              </div>
              <div class="search-text">
    		<div class="search-autore">
    <?php echo $autore?>          </div>
    		<div class="search-titolo">
    <?php echo $tit;?>
              </div>
              		<div class="search-datazione">
    
    <?php
    
    		if (get_post_meta(get_the_ID(), "wpcf-datada_pub", true)!=''){
    			$datada=intval(get_post_meta(get_the_ID(), "wpcf-datada_pub", true));
    		}
    		else
    		{
    			$datada=intval(get_post_meta(get_the_ID(), "wpcf-da", true));
    
    		}
    
    		if (get_post_meta(get_the_ID(), "wpcf-dataa_pub", true)!=''){
    			$dataa=intval(get_post_meta(get_the_ID(), "wpcf-dataa_pub", true));
    		}
    		else
    		{
    			$dataa=intval(get_post_meta(get_the_ID(), "wpcf-a", true));
    
    		}
    
    		if (($dataa)==($datada))
    		{
    			$datazione2=$datada;
    		}
    		else{
    			$datazione2=$datada.'-'.$dataa;
    		}
    
    		if (trim(get_post_meta(get_the_ID(), "wpcf-dataacirca_pub", true))=='true') {
    			$datacirca =" circa";
    		}
    		else{
    			$datacirca ="";
    		}
    
    		if ($lang==2) {
    			if (trim(get_post_meta(get_the_ID(), "datadacirca_pub", true))=='true') {
    				$datacirca =" approx.";
    			}
    
    		}
    
    		echo $datazione2.$datacirca;
    ?>
    
           </div>
              </div>
              </a>
    		</li>
    
    		<?php
    	}
    
    ?>
    		      <div class="clear"></div>
    <div class="pagination">
    			<!--Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> -->
    
    <div class="buttons">
    		<div class="nav-next button"><?php previous_posts_link( $prevTXT ); ?></div>
    				<div class="nav-previous button"><?php next_posts_link( $nextTXT, $query->max_num_pages ); ?></div>
    
    </div>
    
    		<?php
    	/* example code for using the wp_pagenavi plugin */
    	if (function_exists('wp_pagenavi'))
    	{
    		echo "<br />";
    		wp_pagenavi( array( 'query' => $query ) );
    	}
    ?>
    	</div>
    
    	      </ul>
    
    		<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>
    
    #15418

    Anonymous
    Inactive

    Hi, I have used the shortcode method and it’s displaying the form and the results perfectly fine.
    It’s only when I select one of the filters, I have them as checkboxes and it adds the query to the URL string ok and the results div fades out and back in but the results haven’t changed. Is there something I’m missing in the results.php file?

    I’ll try and upload it to our testing server but it will need a user name and password that I can’t put on here. Is there a private message function?

    Cheers,
    Mike

    #15393

    Anonymous
    Inactive

    Hello,

    Great plugin! However, when I filter elements the results go to .5 opacity and never return to 1. Looks like an inline style is being applied via S&FP and just isn’t being updated for some reason.

    I have updated the results.php file slightly, but have left the exterior architecture of the result the same, so that’s not the issue. To test it, I put the original results.php back into the site, and it behaved the same.

    http://75.98.171.114/~myewb/resources/

    #15381

    In reply to: Invisible Ajax results


    Anonymous
    Inactive

    Thanks Ross,

    indeed it make sense.

    However where should I put this code ?

    When I insert it I have a PHP error (I’ve tried in my functions.php and on the results.php template)

    $(".searchandfilter").on("sf:ajaxstart",function(){
    console.log("ajax start");
    });
    
    $(".searchandfilter").on("sf:ajaxfinish",function(){
    console.log("ajax complete");
    //so load your lightbox or JS scripts here again
    });

    Thank you for your help

Viewing 10 results - 1,141 through 1,150 (of 1,224 total)