Forums › Forums › Search & Filter Pro › Updating baseline formatting
Tagged: Formatting
- This topic has 6 replies, 2 voices, and was last updated 6 years ago by Anonymous.
-
Anonymous(Private) December 14, 2018 at 4:47 pm #196409
Hello. Within the results.php, can we add a <div> wrapping the featured image, as well as a <div> wrapping and post details? I have been working with this plugin for some time and the only thing I see which is a downside is not having the ability to control the layout since the elements are not housed in wrapping containers.
Additionally, could the logic be re-written so that there are never any empty <p></p> tags rendered? This is a problem that causes formatting issues as well.
<div class=”postFeatureGraphic”>
<?php
if ( has_post_thumbnail() ) {
echo ‘<p>’;
the_post_thumbnail(“small”);
echo ‘</p>’;
}
?>
</div>
<div class=”postDetails”>
<h2>“><?php the_title(); ?></h2>
<p class=”postDate”><?php echo get_the_date(); ?></p>
<p><?php the_category(); ?></p>
<p class=”postExerpt”><?php the_excerpt(); ?></p>
</div>Trevor(Private) December 14, 2018 at 5:20 pm #196427You can edit that file to your heart’s content. Some people almost completely re-write it. It is only intended as a simple exemplar. Often, you will find theme template use a similar If and while structure, and you can often copy and paste chucks of code from the theme templates into our results.php file.
Make sure the copy you are editing is within your child theme folder, in a sub folder called search-filter.
Anonymous(Private) December 14, 2018 at 5:34 pm #196447Thanks, Trevor. So to copy the results.php to my child theme and customize, would I create a folder called “search-filter” at the root of the child theme, then under that add another folder called “templates” housing the templates.php? I’m assuming that the folder structure would need to match.
Thanks for all your help!
Trevor(Private) December 14, 2018 at 5:45 pm #196457No templates folder. results.php goes directly in to the search-filter folder. See this page:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
-
AuthorPosts