Forums › Forums › Search & Filter Pro › Not keep same design as my post after request
- This topic has 11 replies, 2 voices, and was last updated 3 years, 11 months ago by Trevor.
-
Anonymous(Private) November 30, 2020 at 3:10 pm #268205
hello, i test your plug on my page
https://tabm.ovh/?page_id=7796
I have create 4 articles with category differents (example 1 article : https://tabm.ovh/?p=7637 )Why on my page on the page https://tabm.ovh/?page_id=7796 , the 4 article are not display correctly.
For example, in the bottom of the page, after the text
“————————————————————————-
Ci dessous le texte en forme avant validation search and filter”
The 4 articles are display correctly with icons by the function “recent post”.
I want this display by searchansfilter pro.
How can i do ?
Thanks for your help
PatrickTrevor(Private) November 30, 2020 at 4:33 pm #268258You are using our shortcode method, so some background is important for me to explain. Our plugin files are located on your server in this location:
…/wp-content/plugins/search-filter-pro
There you will find a sub-folder named
templates
and in that a file namedresults.php
.This documentation:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
tells the user to copy that file to their child theme folder, and place it in to a sub-folder that they should name
search-filter
Note that it is always good practice to use a child theme (this is a WordPress recommendation), as it stops updates of a theme from overwriting or deleting any changes and customizations).
Similarly, if you fail to make that copy of the result.php template file and make your edits to that, then, when our plugin updates, it will overwrite the results.php file in our plugin templates folder.
Then, you edit that results.php file to make the template for the page.
The file, I think, needs this content:
<?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 this file is called directly, abort. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( $query->have_posts() ) { ?> Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <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 while ($query->have_posts()) { $query->the_post(); if(class_exists('WPBMap') && method_exists('WPBMap', 'addAllMappedShortcodes')) { WPBMap::addAllMappedShortcodes(); } ?> <div><?php echo get_the_content(); ?></div> <?php } ?> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <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"; } ?>
This assumes that post post content of these results is as you show in those rows at the bottom of the page, as my method will show all the content of those posts.
-
AuthorPosts