Support Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.






NOTE : Due to personal issue, this Ultimate WP Query Search Filter Plugin is no longer under development. Thanks for the support over the years.

Anyone that come across this page that want to find a realible saerch plugin, here are the list of potential replacements.

Plugin author will no longer giving support here, however you can still asking for help from other users here.
Pages: [1]
Author Topic: uwpqsf - Formatting the custom output
nothanks
Newbie
Posts: 1
Permalink
Post uwpqsf - Formatting the custom output
on: March 15, 2017, 13:52
Quote

Hello!

I have been looking into formatting the custom output for uwpqsf, my function is as follows:

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>'.get_permalink().'</li>';

                               echo '<div class="kentta">';
                               the_field('nimi');
                               echo '</div>';                           
                               echo '<div class="kentta">';
                               the_field('organisaatio');
                               echo '</div>';
                               echo '<div class="kentta">';
                               the_field('paikkakunta');
                               echo '</div>';
                               echo '<div class="kentta">';
                               the_field('puhelinnumero');
                               echo '</div>';
                                echo '<div class="kentta">';
                               the_field('sahkoposti');
                               echo '</div>';
                                echo '<div class="kentta">';
                               the_field('kieli');
                               echo '</div>';
                               
                            
           
			}
                        echo  $apiclass->ajax_pagination($arg['paged'],$query->max_num_pages, 4, $id, $getdata);
		 } else {
					 echo  'Ei kouluttajia.';
				}
				/* Restore original Post Data */
				wp_reset_postdata();

		$results = ob_get_clean();		
			return $results;
}

I want to get it to output all of the custom fields of one post separately, so that I can arrange them as follows:

Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli
Nimi | Organisaatio | paikkakunta | puhelinnumero | sahkoposti | kieli

So each set of fields for each of the posts I want to be able to separate and style accordingly.

I hope I made some sense. 😕

Thanks!

tck30
Administrator
Posts: 530
Permalink
Post Re: uwpqsf - Formatting the custom output
on: March 17, 2017, 04:00
Quote

Please refer to this thread.

New Add-On Plugins for Ultimate WP Query Search Filter has been released! Check it out now.

Buy Me A Beer! Thanks

Pages: [1]