have_posts() && $boxid > 0) : while ($boxquery->have_posts()) : $boxquery->the_post(); $thumbnail_id = get_post_thumbnail_id($post->ID); $alt = esc_html(get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true)); $image = esc_url(get_the_post_thumbnail_url($post->ID, 'fhotel-food-lite-home-box-size')); $titless = esc_html(get_the_title($post->ID)); $my_postid = $post->ID; $content = esc_html(fhotel_food_lite_get_excerpt($my_postid, '250')); $url = esc_url(get_the_permalink($my_postid)); $boxvariable[] = array('boxid' => $post->ID, 'boximage' => $image, 'alt' => $alt, 'box_title' => $titless, 'box_content' => $content, 'url' => $url); endwhile; wp_reset_postdata(); endif; ?>