Support » Plugin: A-Z Listing » How to add thumbnail on the list?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Daniel Llewellyn



    To show the thumbnail you need to modify the template that the plugin uses. Copy the file at wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme’s folder and modify as follows:

    Add a new line beneath line 54 with:

    $post = $a_z_query->get_the_item_object();

    Then inside the <li> on line 56 thru 60 add (probably on line 58 as part of the link):

    <?php echo get_the_post_thumbnail( $post, 'post-thumbnail', '' ); ?>

    The second item on the function call which is set to post-thumbnail above needs to be an image size that is provided by your theme. See the get_the_post_thumbnail() documentation on for information on using the function, which is part of WordPress.



    I tried this doesnt work help!

    @lovebexa I debugged code and I found that you have to call the function with one parameter:

    $post = $a_z_query->get_the_item_object('I understand the issues!');

    Plugin Author Daniel Llewellyn



    I completely failed to remember that bit when I posted the above code snippet. Thanks, @filomedio, for posting the correct call.

    The purpose of that statement is that pulling the whole object will potentially slow down or break larger listings, so I wanted to make sure people really understood the implication when they use it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add thumbnail on the list?’ is closed to new replies.