Forums › Forums › Search & Filter Pro › Showing "No results available for this search"
Tagged: empty results, filtering
- This topic has 5 replies, 2 voices, and was last updated 8 years, 9 months ago by
Trevor.
-
Anonymous(Private) December 8, 2016 at 7:26 am #75034
I found a file called template-archive.php inside betheme folder and here is the content of the file. Can you please tell me if it is the correct file to edit. I tried to make if else condition to check if there is any posts, if no, then display there is no results for this search but doesn’t work.
Can you please guide me.<?php /** * Template Name: Archives * * @package Betheme * @author Muffin Group */ get_header(); ?> <div id="Content"> <div class="content_wrapper clearfix"> <!-- .sections_group --> <div class="sections_group"> <div class="section"> <div class="section_wrapper clearfix"> <?php if (have_posts()){ the_post(); } ?> <div class="one-fourth column"> <h4><?php _e('Available Pages', 'betheme'); ?></h4> <ul class="list"> <?php wp_list_pages('title_li=&depth=-1'); ?> </ul> </div> <div class="one-fourth column"> <h4><?php _e('The 20 latest posts', 'betheme'); ?></h4> <ul class="list"> <?php $args = array( 'post_type' => array('post'), 'posts_per_page' => 20 ); $posts_query = new WP_Query($args); /*if (have_posts()):*/ while ($posts_query->have_posts()) : $posts_query->the_post(); ?> <li><a>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; /* else : echo wpautop('Sorry, no posts were found'); endif;*/ wp_reset_query(); ?> </ul> </div> <div class="one-fourth column"> <h4><?php _e('Archives by Subject', 'betheme'); ?></h4> <ul class="list"> <?php $args = array( 'orderby' => 'name', 'show_count' => 0, 'hide_empty' => 0, 'title_li' => '', 'taxonomy' => 'category' ); wp_list_categories($args); ?> </ul> </div> <div class="one-fourth column"> <h4><?php _e('Archives by Month', 'betheme'); ?></h4> <ul class="list"> <?php wp_get_archives('type=monthly'); ?> </ul> </div> </div> </div> </div> </div> </div> <?php get_footer(); ?>
Trevor(Private) December 8, 2016 at 5:19 pm #75138I do not know if that is the right template, but you can test quite easily by changing this:
<div id="Content">
to this:
<div id="Content" class="sftest">
and then inspect the page code to see it it is there.
If you need to post any code here in the forum, on the editor toolbar you will see a
code
button. Place one of these before and one after all code blocks. Otherwise our forum software will change what you post. -
AuthorPosts