Support » Plugin: Ultimate WP Query Search Filter » Showing the result as a post

  • Hi there,
    Great plugin and works great. However, when the user clicks “Search” after putting in a filter, the result comes out as a link to the post rather than having the post appear with AJAX underneath. How do I fix this? This is the site I’m working on: https://www.aast.umd.edu/undergraduate/course-catalog/

    If you select either of the drop down menu and hit search, a link called “Fall 2015” for example pops up which takes you to the post. But I’d like the post to appear right underneath in the same way the post that you see when you first visit the site appears. If I select a different semester I’d like that semester’s courses to appear in place of the one that currently displays. Hope this makes sense.

    Thanks

    https://wordpress.org/plugins/ultimate-wp-query-search-filter/

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

    (@wp_dummy)

    But I’d like the post to appear right underneath in the same way the post that you see when you first visit the site appears

    To customize the results, please refer to this post.

    I’d like that semester’s courses to appear in place of the one that currently displays.

    Get the div that wrapped the table (either class or id). And change it in the form Result Div.

    Thanks for the quick reply. I got the results to display exactly where I want it to per your suggestion. I’m still having trouble displaying the actual post. It’s still spitting out the link to the post rather than displaying the post itself. I referred to the link you posted but I can’t make sense of how I can use it to fix my issue. I assume its under the result setting and others but I haven’t touched that at all in my form. I don’t see how any of that applied.

    Thanks again for your continued support.

    Plugin Author TC.K

    (@wp_dummy)

    You have to know how to use WP functions to get what you want. At the post, it is only an example how you can use the filter uwpqsf_result_tempt to customize the results. You may need to customized your own to fit your need.
    For example, follows code will shows the title and the content of results.

    add_filter('uwpqsf_result_tempt', 'customize_output', '', 4);
    function customize_output($results , $arg, $id, $getdata ){
    	 // The Query
                $apiclass = new uwpqsfprocess();
                 $query = new WP_Query( $arg );
    		ob_start();	$result = '';
    			// The Loop
    
    		if ( $query->have_posts() ) {
    			while ( $query->have_posts() ) {
    				$query->the_post();global $post;
                                    echo  '<li><a href="'.get_permalink().'" >'.get_the_title().'</a></li>';
                                    echo get_the_content();
    			}
                            echo  $apiclass->ajax_pagination($arg['paged'],$query->max_num_pages, 4, $id, $getdata);
    		 } else {
    					 echo  'no post found';
    				}
    				/* Restore original Post Data */
    				wp_reset_postdata();
    
    		$results = ob_get_clean();
    			return $results;
    }

    Remember this code have to put in your theme’s functions.php.

    Sweet. That’s perfect. Only one question: Do you know how to access the functions.php from the wp dashboard? I have always accessed it using FileZilla but I can’t in this case because I’m not the owner of the website. I’m running WordPress 4.2.2

    Thanks

    Plugin Author TC.K

    (@wp_dummy)

    well, you can goto Appearance->editor and find the functions.php there.
    But I strongly recommend you don’t use it, if you are doing something wrong, you messed up the entire site. A simple typo will make you can’t access to the wp-admin (and also frontend) and you can’t fix that error once you make a mistake.

    If it is not your site, ask the owner to give your the ftp or the hosting account.

    Ok. I now have access to all the hosting account details and a ftp. Should I go ahead and copy-paste the code you have provided into the editor? As you have warned, if something goes wrong I’ll lose access to wp-admin. Will the ftp details allow me to go into the root directory and reset these changes? I have never really done editing before so I don’t know what to do if something went wrong.

    Edit: Can I not do the edits from the plugin editor? I understand I can access the plugin’s functions.php file? Can the code you provided be entered there to give me the desired results?

    Plugin Author TC.K

    (@wp_dummy)

    Actually there are many way to edit and customize a site. Google it will give you a lot of answer. This is beyond the plugin support question.
    Anyway, by using ftp, if there is error on the script you can always undo you changes and upload to override the file again.

    The file that meant to change is the theme’s functions.php not the plugin functions.php.

    Can the code you provided be entered there to give me the desired results?

    Like I said, it’s only an example. I don’t know what you want and how your theme design is, thus I can’t really tell you the exact solution. If you aren’t sure and don’t know how to code, you probably need to learn coding first, or ask someone who know WordPress to do it for you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Showing the result as a post’ is closed to new replies.