• 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!

    • This topic was modified 7 years, 11 months ago by kotkaks.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TC.K

    (@wp_dummy)

    Not quite understand what you want. Please elaborate more.

    Thread Starter kotkaks

    (@kotkaks)

    Allright, so..

    I want to be able to style the output so that it differentiates each set of those 6 fields. Like this:

    example

    Every row is a different custom article. every custom article has those 6 fields. I’m using advanced custom fields pro to do that.

    Hope this helped. ??

    Plugin Author TC.K

    (@wp_dummy)

    The content is correct, all this has to do with your design. There are numerous way to do so. I can’t tell specific way. You can use div,ul, table etc. It is all about html and css. If your theme support bootstrap, this table class is something worth to look at.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Formatting the custom output’ is closed to new replies.