Forums Forums Search & Filter Pro Display results in a grid view

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #51747

    Hi, is there a way to display results in a grid view after searching? I’m using Enfold as a theme but styling is not a big priority, however it would be great if I could apply the theme style to the grid results as well. But at this point, I would just like to be able to view results as a grid.

    Thanks!

    Trevor
    #51794

    It depends on what template is being used for the results. If you are using the shortcode method, it uses our results.php template. You can edit this to give you a grid (you can modify it to look and behave like a theme template). If you are using as an archive or Post Archive methods, they use your theme’s templates, in which case uses one that has a grid.

    Anonymous
    #51832

    Trevor, thanks for the reply. I’m using the shortcode method. I’d appreciate it if you can tell me how to work with the results.php file.

    I managed to find the follow code from the Enfold forum:

    <?php
    global $avia_config;
    
    /*
    * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    */
    get_header();
    
    $results = avia_which_archive();
    echo avia_title(array(‘title’ => $results ));
    ?>
    
    <div class=’container_wrap container_wrap_first main_color <?php avia_layout_class( ‘main’ ); ?>’>
    
    <div class=’container’>
    
    <main class=’content template-search <?php avia_layout_class( ‘content’ ); ?> units’ <?php avia_markup_helper(array(‘context’ => ‘content’));?>>
    
    <div class=’page-heading-container clearfix’>
    <section class=”search_form_field”>
    <?php
    echo “<h4>”.__(‘Andere zoekopdracht’,’avia_framework’).”</h4>”;
    echo “<p>”.__(‘Vul hier Uw nieuwe zoekopdracht in:’,’avia_framework’).”</p>”;
    
    get_search_form();
    echo “<span class=’author-extra-border’></span>”;
    ?>
    </section>
    </div>

    Do you know exactly where in the results.php template that I can paste this into? Or would this code even work in the first place if I want to display the results as a grid?

    I’m assuming I would need to place the above code at some place in this section, correct?

    <?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		<div>
    			<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
    <br>
    		</div>
    		
    		<hr />

    Thanks for your help!

    Trevor
    #51860

    The first issue with the first block of code is that the single and double quotes are the ‘smart’ type (curly) and need to be straight ones. I will come back to you tomorrow on this. It is late here now.

    Trevor
    #52909

    Where are we on this one? Did you check to make sure you used the correct quote marks? (NOT the curly smart ones)?

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