The forums are closed and will be removed when we launch our new site.
Looking for support? You can access the support system via your account.
Forums › Forums › Search & Filter Pro › Aligning Post Title and featured image in results
Tagged: featured image, results
- This topic has 17 replies, 2 voices, and was last updated 6 years ago by Leander Leist.
-
Leander Leist(Private) September 3, 2018 at 5:28 pm #187095
Hey, i am trying to make S&F show the results like this:
featured image from Post , post title
i would like to have them in one line.
This is my Code so far:
<?php
/**
* Search & Filter Pro
*
* Sample Results Template
*
* @package Search_Filter
* @author Ross Morsali
* @link https://searchandfilter.com
* @copyright 2018 Search & Filter
*
* 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() )
{
?><?php echo $query->found_posts; ?> Ergebnisse gefunden<br />
<div class=”pagination”>
<div class=”nav-previous”><?php next_posts_link( ‘Older posts’, $query->max_num_pages ); ?></div><br />
<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
while ($query->have_posts())
{
$query->the_post();?>
<div>
<h2>“><?php the_title(); ?></h2><br /><?php
if ( has_post_thumbnail() ) {
echo ‘<p>’;
the_post_thumbnail(“small”);
echo ‘</p>’;
}
?></div>
<hr />
<?php
}
?><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”;
}
?>##################################################################################
Thanks for your help
regards
LeanderTrevor Moderator(Private) September 4, 2018 at 12:29 pm #187149This would normally be done in ‘columns’ in most themes or page builders. Excluding Search & Filter related pages, do you have an example page (either in your site, or a demo site for your theme) that shows a similar layout?
Leander Leist(Private) September 4, 2018 at 5:55 pm #187280This is the site i am working on.
https://leist.osteopathiefortbildung.de/index.php/kurse/I am using BeTheme and Visual Composer / WP Bakery Page Builder. There is an option called Post Grid, that i used on the “Dozenten” Page to Display Posts. Its not the same but similar.
This has Posts shown in the lower area. Its BeTheme.
https://themes.muffingroup.com/be/press/I think columns would work. Two. Image left, Title / Link right.
hope this is Helpful.
Thanks!
Trevor Moderator(Private) September 4, 2018 at 6:00 pm #187282Would it work for you to use Visual Composer then, as we have an addon for it to work with the Post grid element anyway?
Trevor Moderator(Private) September 5, 2018 at 10:26 am #187313Leander Leist(Private) September 6, 2018 at 4:22 pm #187495Perfect Solution! Thanks a lot.
There is one problem though. The submit button does not work. I tried to enable auto submit, even tough it changes the url the results do not get loaded according to the new filters. This happens only if i reload the page manually.
Can this be fixed somehow?
Trevor Moderator(Private) September 6, 2018 at 4:32 pm #187499Can you give the me current search page URL, and details steps I need to take to see this?
Leander Leist(Private) September 6, 2018 at 5:13 pm #187522https://leist.osteopathiefortbildung.de/index.php/kurse/
Just use one of the dropdown filters.
it should automatically load the results or load them after clicking the Button.
But it doesn’t. Thats the problem.Trevor Moderator(Private) September 6, 2018 at 5:22 pm #187526This reply has been marked as private. -
AuthorPosts
The topic ‘Aligning Post Title and featured image in results’ is closed to new replies.