Title: Thumbnail bug with shortcode post
Last modified: August 3, 2021

---

# Thumbnail bug with shortcode post

 *  Resolved [insp4fr](https://wordpress.org/support/users/insp4fr/)
 * (@insp4fr)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/thumbnail-bug-with-shortcode-post/)
 * Hello,
 * Mostly for information, and potential improvement.
 * We are using a few ultimate shortcodes on our future site and got to spend some
   time on a bug before discovering the “bug” doesn’t appear when debug mode is 
   off.
 * Description of the bug
    – context : Debug mode ON , ie in wp-config.php we have:
   define(‘WP_DEBUG’, true); define(‘WP_DEBUG_DISPLAY’, true); define(‘WP_DEBUG_LOG’,
   true);
 * – test page content for Shortcode Ultimate :
 *     ```
       <strong>single-post</strong>
       [su_posts template="templates/single-post.php" posts_per_page="10" post_type="post" taxonomy="test-equipes" tax_term="84" tax_operator="IN" offset="0" order="desc" orderby="date" post_status="publish" ignore_sticky_posts="no"]
   
       <strong>list-loop</strong>
       [su_posts template="templates/list-loop.php" posts_per_page="10" post_type="post" taxonomy="test-equipes" tax_term="84" tax_operator="IN" offset="0" order="desc" orderby="date" post_status="publish" ignore_sticky_posts="no"]
   
       <strong>default-loop</strong>
       [su_posts taxonomy="test-equipes" tax_term="84" order="desc"]
   
       <strong>teaser-loop</strong>
       [su_posts template="templates/teaser-loop.php" posts_per_page="10" post_type="post" taxonomy="test-equipes" tax_term="84" tax_operator="IN" offset="0" order="desc" orderby="date" post_status="publish" ignore_sticky_posts="no"]
       ```
   
 * – Display of the page
    => the problem appear for the loops “default-loop” and“
   teaser-loop” => in all our tests the icon of the first post displayed never appear,
   but all the others does => the error messages displayed on the page say “Notice:
   Trying to get property of non-object in …/wp-includes/post-thumbnails: template.
   php on line 106”
 * – Display of the page after activating the “Query Monitor” plugin :
    => the page
   appear OK : we have all the post icons and no error message, but… => in the “
   PHP Errors” list of the “Query Monitor” screen we have : Level Message Place 
   Notification Trying to get property of non-object wp-includes/post-thumbnail-
   template.php:106 Notification Undefined property: WP_Tax_Query::$ID wp-includes/
   post-thumbnail-template.php:106 Notification Undefined property: WP_Meta_Query::
   $ID wp-includes/post-thumbnail-template.php:106
 * The number of first notification match the number of posts to be displayed.
 * – Display of the page, with Debug mode OFF :
    => everything “seems” OK
 * Sincerely,
    insp4fr

The topic ‘Thumbnail bug with shortcode post’ is closed to new replies.

 * ![](https://ps.w.org/shortcodes-ultimate/assets/icon-256x256.gif?rev=2547563)
 * [WP Shortcodes Plugin — Shortcodes Ultimate](https://wordpress.org/plugins/shortcodes-ultimate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcodes-ultimate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-ultimate/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-ultimate/reviews/)

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * 0 replies
 * 1 participant
 * Last reply from: [insp4fr](https://wordpress.org/support/users/insp4fr/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/thumbnail-bug-with-shortcode-post/)
 * Status: resolved