Forums Forums Search & Filter Pro Layout

Viewing 10 posts - 31 through 40 (of 41 total)
  • Anonymous
    #124494
    This reply has been marked as private.
    Trevor
    #124498
    This reply has been marked as private.
    Trevor
    #126083

    This is the customised results.php to work in your child theme of the Primrose theme, making it look like the grid you made with SiteOrigin:

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      http://www.designsandcode.com/
     * @copyright 2015 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; ?> Results<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( '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>
    
    	<div id="sf-custom-results" class="panel-layout">
    	<?php
    	$result_counter=0;
    	$data_index=0;
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		<div class="sf-results-row panel-grid panel-no-style">
    
    			<div class="sf-results-leftcol panel-grid-cell">
        <div class="so-panel widget widget_sow-image panel-first-child panel-last-child" data-index="<?php echo $data_index++;?>">
    					<div class="so-widget-sow-image so-widget-sow-image-default-eef982a7180b">
          <div class="sow-image-container">
    						<?php 
    							if ( has_post_thumbnail() ) {
    								the_post_thumbnail("full");
    							}
    						?>
    						</div>
    					</div>
        </div>
    			</div>
    
    			<div class="sf-results-rightcol panel-grid-cell">
    				<div class="so-panel widget widget_sow-editor panel-first-child panel-last-child" data-index="<?php echo $data_index++;?>">
    					<div class="so-widget-sow-editor so-widget-sow-editor-base">
    						<h3 class="widget-title"><?php the_title(); ?></h3>
    						<div class="siteorigin-widget-tinymce textwidget">
    							<header class="w2dc-listing-header"><p>blah</p></header>
    							<p><br /><?php the_excerpt(); ?></p>
    						</div>
    					</div>
    				</div>
    			</div>
    
    		</div>
    		
    		<?php
    			//$result_counter++;
    	}
    	?>
      </div>
      <div>Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?></div>
    	
    	<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";
    }
    ?>

    This is the Custom CSS that accompanies it:

    .sf-results-leftcol.panel-grid-cell {
        width: 25% !important;
        width: calc(25% - ( 0.750000001875 * 40px)) !important;
    }
    .sf-results-rightcol.panel-grid-cell {
        width: 75% !important;
        width: calc(75% - ( 0.249999998125 * 40px)) !important;
    }
    #sf-custom-results .so-panel {
        margin-bottom: 0;
    }
    #sf-custom-results div.sf-results-row:nth-last-child(2) {
        margin-bottom: 0;
    }
    #sf-custom-results .sf-results-row {
        -webkit-align-items: flex-start;
        align-items: flex-start;
        margin-bottom: 40px;
    }
    @media (max-width: 767px) {
        .sf-results-leftcol.panel-grid-cell,
        .sf-results-rightcol.panel-grid-cell {
            width: 100% !important;
        }
        .sf-results-row {
            -webkit-flex-direction: column;
            -ms-flex-direction: column;
            flex-direction: column;
        }
        .sf-results-row .sow-image-container {
            text-align: center;
        }
    }
    Anonymous
    #126325

    Hi Trevor,

    Thank you again for your help. I’m just having an issue with the results, for some reason they all have the word ‘blah’ at the start of them. I have no idea where it is coming from.

    Also, should the user be able to click the result to go through to the actual listing on the directory?

    Trevor
    #126404

    It is in the code, where the title should be:

    <header class="w2dc-listing-header"><p>blah</p></header>
    

    If you want that to be the title with a link, it might want to be:

    <header class="w2dc-listing-header"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></header>
    
    Anonymous
    #126545

    Thank you, that has worked.

    I have added two new sub categories to the ‘consultant type’ category but they have not appeared in the drop down. Do you know why this may be? I added a location as well and that has appeared in the Location category.

    Trevor
    #126641

    I don’t know why they haven’t appeared, no. Have they been used in any posts, and are those posts in the results?

    Anonymous
    #127058

    No they haven’t been used in any posts as of yet. I feel that I may not have added them correctly maybe? I just added the categories to the directory plugin thinking it would link up. Is there a certain way I’m supposed to do it? Or can you please direct me to some documentation that may help.

    Trevor
    #127078

    What happens if you add a main category in consultant type?

    What happens if you add one of these new types to a post?

    Anonymous
    #128478

    The categories I have added are main categories. I have just tried to add a test listing and add it to the categories that aren’t appearing, and the test listing is not even showing up in the search results. And neither are the new categories I’ve tried to add.

Viewing 10 posts - 31 through 40 (of 41 total)