Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author TC.K

    (@wp_dummy)

    It shouldn’t behave like this. Are you sure all of your posts are published? Because it is only search for published posts.

    One possible this could happen if you add ‘user’ parameter in the query, but I don’t think you have done this. Because this will required using ‘ajax_wpqsf_query’ to add the parameter to the query.

    I added user parameters but on the displaying part, not on the search query. So the first thing I did was getting rid of those user role parameters, but still displayed the same results.

    Oh, and the posts are definitely published. This is very strange :S

    Plugin Author TC.K

    (@wp_dummy)

    Hmmm….did you set the Sorting Meta Key at the Result Setting section? If you did set the meta key there, it will filter the posts that only have that particularly meta key.

    Can you give me your link?

    I did change the sorting meta key, but it was blank in the beginning. I tried getting it back to blank but I’m still getting the same results.

    This is the website I’m working on:
    https://www.rodadosfueguinos.com.ar

    Plugin Author TC.K

    (@wp_dummy)

    Have you click the save button after you change sorting meta key back to blank? I think this probably the reason you get this problem.

    Hahahahaa! I’ve definitely done that ;P

    Could it be something related to the hook for displaying results? I think the problem must be there.

    add_filter('ajax_wpqsf_reoutput', 'customize_output', '', 4);
    function customize_output($results , $arg, $id, $getdata ){
    	// The Query
    	$apiclass = new ajaxwpqsfclass();
    	$query = new WP_Query( $arg );
    	ob_start();   //$results ='';
    		// The Loop
    		if ( $query->have_posts() ) {
    			while ( $query->have_posts() ) {
    				$query->the_post();
    					echo '<li>'.get_permalink().'</li>';
    			}
    			echo $apiclass->ajax_pagination($arg['paged'],$query->max_num_pages, 4, $id);
    		} else {
    			echo 'No se han encontrado resultados.';
    		}
    		/* Restore original Post Data */
    		wp_reset_postdata();
    
            $results = ob_get_clean();
                return $results;
    }

    It also might be important to mention that I’m using a custom post type.

    Plugin Author TC.K

    (@wp_dummy)

    No, the result is based on the argument in the $arg, if you didn’t alter anything in the $arg, it would not affect the result.

    Can you try to create another search form, this time without the meta sorting key. See if it is the cause of your problem.

    Ok! I got it working now ??

    The problem was that some of the meta key fields I used as search filters were blank in the rest of the post that were not being showed. I filled them up and now they appear between the search results ??

    Plugin Author TC.K

    (@wp_dummy)

    Good.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Displaying search results only for one role?’ is closed to new replies.