Please help me to this code
-
<?php global $post; $category = get_the_category($post->ID); $category = $category[0]->cat_ID; $myposts = get_posts(array('numberposts' => -1, 'category__in' => $category)); foreach($myposts as $post) : setup_postdata($post); ?> <?php $field = get_field_object('hotel_in'); $value = get_field('hotel_in'); $label = $field['choices'][ $value ]; $posts = get_posts(array( 'numberposts' => -1, 'meta_key' => $field, 'meta_value' => $value )); if($posts) { echo 'Hotel in ' .$label .'<ul>'; foreach($posts as $post) { echo '<li><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></li>'; } echo '</ul>'; } ?> <?php endforeach; ?> <?php wp_reset_query(); ?>
Error to display :
Warning: trim() expects parameter 1 to be string, array given in D:\xampp\htdocs\newdh\wp-includes\meta.php on line 774
Please help me.Thanks a lot.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Please help me to this code’ is closed to new replies.