get_post_meta returns empty
-
I have updated a hook to pull in one line of post meta, but nothing is returned. Any suggestions? Here’s the code:
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 '<li>'.get_post_meta('33', 'course2_title', true).'</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; }
https://www.ads-software.com/plugins/ajax-wp-query-search-filter/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_post_meta returns empty’ is closed to new replies.