Tagged: 3 columns, pagination, search results
-
AuthorPosts
-
September 3, 2014 at 10:13 am #312738
Hello,
Is it possible to display search reasults in grid 3 columns with pagination ?
I’ve seen a topic where is asking this. This is the answer:
1) Insert following code into the quick css field:
.template-search .post-entry {
clear: none !important;
}2) In search.php replace:
if(!empty($_GET[‘s’]))
{
echo “<h4 class=’extra-mini-title widgettitle’>{$results}</h4>”;/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-search.php and that will be used instead.
*/
$more = 0;
get_template_part( ‘includes/loop’, ‘search’ );}
with:
if(!empty($_GET[‘s’]))
{
echo “<h4 class=’extra-mini-title widgettitle’>{$results}</h4>”;global $posts;
$post_ids = array();
foreach($posts as $post) $post_ids[] = $post->ID;$atts = array(
‘type’ => ‘grid’,
‘items’ => get_option(‘posts_per_page’),
‘columns’ => 2,
‘class’ => ‘avia-builder-el-no-sibling’,
‘paginate’ => ‘yes’,
‘use_main_query_pagination’ => ‘yes’,
‘custom_query’ => array( ‘post__in’=>$post_ids, ‘post_type’=>get_post_types() )
);$blog = new avia_post_slider($atts);
$blog->query_entries();
echo “<div class=’entry-content’>”.$blog->html().”</div>”;
}This works all fine but there is no pagination. Is there a way to get the pagination here? =)
Kind regards,
Pieter L.
- This topic was modified 10 years, 3 months ago by pieterpieterpieter.
September 5, 2014 at 12:06 am #313682Hi Pieter!
Pagination will appear when number of the posts being shown exceed the “Blog pages show at most” setting (Settings > Reading).
Best regards,
JosueSeptember 11, 2019 at 8:32 pm #1137238Hi,
How to add a custom result when there is no match.
I mean if I search for DOG and there is no DOG post or image on the website, what and where can I add to have for example a custom image or link to appear (let’s say a referral sponsored link).
ThanksOlivier
September 13, 2019 at 9:50 am #1137863Hi coumoliv,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.