A site I made required the display of WordPress post information (title, tags, thumbnails). The PHP code which gets this information from published posts works on my localhost and the post data displays properly.
I just uploaded the site onto my host's server, configured the WP settings to be identical to my localhost WP install, and while 99% of the site works as expected, the information for posts does not display.
There are 3 test posts on the live site currently. I can see 3 article tags through the DOM inspector, so the WP loop to retrieve posts works fine. However, within each article tag, the entry-content tag, which should contain the data, is empty.
All other php code is executing but this little block. Anyone have some advice on resolving the issue?
Here are images (yellow highlight showing the article tags):
First one of the live server, the empty div:
Second on of the localhost, data displaying fine:
Here is the relevant code:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
and just below that code is the PHP that displays the thumbnail...(the PHP display code for the other post data like title is omitted). None of the data displays on the site:
<figure class="gallery-thumb">
<span class="image-wrapper">
<?php echo $image_img_tag; ?>
All these divs and the figure tags are closed properly further below the page.
Thanks for any help.
$imagesdoesn't evaluate tofalseor an empty array and yourifends before figure? - Dehalion