Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #631103

    Hi Guys,

    I am trying to figure out how to display a grid format search page. I am getting close. I have the grid format thanks to a few threads around this forum regarding changing the search.php file (in child-theme of course) however I am trying to run a loop for each post type on the avia_post_slider object however cannot seem to get it to work. Code snippet below..

    global $posts;
    					$post_ids = array();
    					$post_types = array();
    					foreach($posts as $post) {
    						$post_types[$post->post_type][] = $post->ID;	
    						//$post_ids[] = $post->ID;
    					}
    					
    						if(!empty($post_types)){
    								foreach(array_keys($post_types) as $ptype){		
    										echo $ptype;
    											// postslider.php filter 'avia_post_slide_query' $query, $params	
    											$args = array(
    														'type' =>'grid',
    														'items' => get_option('posts_per_page'),
    														'columns' => 4,
    														'class' => 'avia-builder-el-no-sibling',
    														'paginate' => 'yes',
    														'use_main_query_pagination' => 'yes');
    														
    														
    												$query = array('custom_query' =>array('post__in' => array_values($post_types[$ptype]),
    																			  'post_type' => $ptype,
    																			  'orderby' => 'post_type',
    																			  'order' => 'DESC'));
    										
    										
    											$blog = new avia_post_slider($args);
    											$blog->query_entries($query);
    											echo "<div class='entry-content'>".$blog->html()."</div>";
    								}
    						
    									
    						}
    						else{
    							get_template_part( 'includes/loop', 'search' );
    						}
    						

    Also a screenshot here:

    http://imgbox.com/zHynwxrp

    #632296

    Hey Bass,

    Thank you for using Enfold.

    Replace the includes > loop-search.php file with the following: http://pastebin.com/F29fTbJ5

    Add this in the Quick CSS field:

    .template-search .post-entry {
        clear: none;
    }

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.