Search results in posting same image over and over
-
Hi everyone,
I’m using WP 4.7.3 along with the photography theme “Tripod”, “Search Everything” and “Media Library Assistant” plugins.
Everything is working fine, but when searhing for an item the results page is a little off.
The title in the search results page is fine and everything else, but the images. The first postet image is always the correct one but the following is just the first image posted over and over again.
See for yourselves:
Search ResultsHere is the code from the search.php:
<?php get_header(); ?> <?php $template = 'search'; ?> <section id="main"> <div class="main-container"> <div class="row"> <div class="twelve columns cat-title"> <?php if( have_posts () ){ ?> <h2> <span> <?php _e( 'Search results: ' , 'cosmotheme' ); ?> </span> </h2> <?php }else{ ?><h2 ><span><?php _e( 'Sorry, no posts found' , 'cosmotheme' ); ?></h2></span><?php } ?> </div> </div> <?php $layout = new LBSidebarResizer( 'search' ); $layout -> render_frontend(); ?> </div> </section> <?php get_footer(); ?>
and a part of the post.class.php
static function search(){ /*used for search inputs to search for posts when user types something*/ $query = isset( $_GET['params'] ) ? (array)json_decode( stripslashes( $_GET['params'] )) : exit; $query['s'] = isset( $_GET['query'] ) ? $_GET['query'] : exit; global $wp_query; $result = array(); $result['query'] = $query['s']; $wp_query = new WP_Query( $query ); if( $wp_query -> have_posts() ){ foreach( $wp_query -> posts as $post ){ $result['suggestions'][] = $post -> post_title; $result['data'][] = $post -> ID; } } echo json_encode( $result ); exit(); }
I really appreciate any help on this, since the theme author does not reply to comments or tickets any more.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Search results in posting same image over and over’ is closed to new replies.