Forums Forums Search & Filter Pro Filter on Thrive Theme Builder post grid

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #45972

    I’m using Thrive Themes for my WordPress theme. Inside a page where I have classic Corvettes listed for sale, I’d like to set up a searchandfilter on only the Corvettes listed there. I have many other types of cars…I just want the filter to be on the Corvettes on this page only.

    For example, I want them to be able to search by year, exterior color, only on the corvettes shown on this page: http://www.collectorsector.com/classic-corvettes-for-sale

    How can I do this?

    Trevor
    #45991

    I would need to know a little about your site structure (in the admin).

    Do you have a Custom Post Type for Corvettes or for Autos in General?

    How is the make of the auto stored (taxonomy or custom field)?

    How is the model of the auto stored (taxonomy [same as make or different?] or custom field)?

    Anonymous
    #45992

    I have a custom post type for autos in general called “Cars”.

    Both make and model are stored as independent taxonomies–I could join them together into one if it would make things any easier.

    Trevor
    #45993

    I could join them together into one if it would make things any easier.

    That would make it harder 🙂

    Are you on Skype? We could do this fast, but I do not know where you are in the world. In North America it must be the middle of the night right now?

    Anonymous
    #46000

    Yes I can jump on Skype, are you on right now?

    Trevor
    #46001
    This reply has been marked as private.
    Trevor
    #46049
    This reply has been marked as private.
    Trevor
    #46150

    Got the files. I will post the results.php here for others to use if they wish, with their copy of Ignition and Thrive Visual Builder:

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Thrive Results Template
     * 
     * @package   Search_Filter
     * @author    Trevor Nelmes
     * @link      http://www.designsandcode.com/
     * @copyright 2016 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 ( $query->have_posts() )
    {
    	?>
    	
    	Found <?php echo $query->found_posts; ?> Cars<br />
    	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( 'Previous Page of Cars', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Next Page of Cars' ); ?></div>
    		<?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query ) );
    			}
    		?>
    	</div>
    	<div class="thrv_wrapper thrv_post_grid" data-unit="px">
    	  <div class="tve_post_grid_wrapper tve_clearfix tve_post_grid_grid">
    
            <div style="display: flex; flex-wrap: wrap;" class="tve_pg_row tve_clearfix">
    
    	<?php
        $thrive_counter = 0;
        $thrive_row_counter = 0;
    	while ($query->have_posts())
    	{
          if ( $thrive_counter == 0 ) && ( $thrive_row_counter > 0 ) {
          ?>
    	    </div>
            <div style="display: flex; flex-wrap: wrap;" class="tve_pg_row tve_clearfix">
          <?php
          }
          $query->the_post();
    		
          ?>
    			<div class="tve_post tve_post_width_5 " style="align-items: stretch;">
                  <div class="tve_pg_container">
    			
    			
    			<?php 
                  if ( has_post_thumbnail() ) {
                    $thrive_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'single-post-thumbnail' );
    			?>
                      <a href="<?php the_permalink(); ?>">
                        <div class="tve_post_grid_image_wrapper" style="background-image: url('<?php echo $thrive_image[0]; ?>')">
                          <div class="tve_pg_img_overlay">
                            <span class="thrv-icon thrv-icon-forward"></span>
                          </div>
                        </div>
                      </a>
    			<?php
                  }
    			?>
    
    		        <span class="tve-post-grid-title " style="font-size: 18px;line-height: 20px;font-family:'Arial', 'Helvetica', 'sans-serif';">
                      <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                    </span>
    
                    <div class="tve_pg_more" data-tve-custom-colour="62938813">
                      <a href="<?php the_permalink(); ?>">View Now</a>
                      <span class="thrv-icon thrv-icon-uniE602"></span>
                    </div>
    			
                  </div>
                </div>
    		
    		<?php
          $thrive_counter++;
          if ( $thrive_counter > 4 ) {
            $thrive_counter = 0;
            $thrive_row_counter++;
          }
    	}
    	?>
    	    </div>
          </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( 'Previous Page of Cars', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Next Page of Cars' ); ?></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";
    }
    ?>

    Note that this search was for Cars for Sale, so some text strings have been modified to suit (like in the number of results and pagination).

Viewing 8 posts - 1 through 8 (of 8 total)