Viewing 2 replies - 1 through 2 (of 2 total)
  • I think the line…

    $post = $a_z_query->get_the_item_object();

    …needs to in the While loop a little further down than line 54. I tried the same instructions but kept getting RETURNed with an empty/null value even querying inside the While loop. Eventually I edited the code below, starting at line 54, in a-z-listing.php in my child theme taking this…

    <ul class="az-columns <?php echo esc_attr( $a_z_listing_column_class ); ?>">
    	<?php
    	while ( $a_z_query->have_items() ) :
    		$a_z_query->the_item();
    		?>
    		<li>
    			<a href="<?php $a_z_query->the_permalink(); ?>">
    				<?php $a_z_query->the_title(); ?>
    			</a>
    		</li>
    	<?php endwhile; ?>
    </ul>

    …and replacing it with this.

    <ul class="az-columns <?php echo esc_attr( $a_z_listing_column_class ); ?>">
    	<?php	
    	while ( $a_z_query->have_items() ) :
    		$a_z_query->the_item();
    		$thumb = get_the_post_thumbnail_url($a_z_query->get_the_item_id(), 'thumbnail');
    		?>
    		<li>			
    			<a href="<?php $a_z_query->the_permalink(); ?>"><img class="a-z-thumb" src='<?php echo $thumb; ?>' /><?php $a_z_query->the_title(); ?></a>
    		</li>
    	<?php endwhile; ?>
    </ul>
    Thread Starter chugs

    (@chugs)

    Thanks a lot @mrchaotix! I got it to work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show post thumbnails’ is closed to new replies.