Title: PHP Warning: Property post_content Divi template layouts
Last modified: November 5, 2023

---

# PHP Warning: Property post_content Divi template layouts

 *  Resolved [declutterdata](https://wordpress.org/support/users/declutterdata/)
 * (@declutterdata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-property-post_content-divi-template-layouts/)
 * Hi Johan,
 * i get the following warning if I use the Player Module in Divi:
   **Warning**: 
   Attempt to read property “post_content” on null in **C:\Users\X\Local Sites\X\
   app\public\wp-content\plugins\am-lottieplayer\am-lottieplayer.php** on line **
   152**
 * Warning is shown if I use the Divi Theme Builder, in my case for a customized
   body for a 404 site.
 * Plugin Code says the following (warning line 152 in bold):
 *     ```wp-block-code
         // Check for Lottie in Divi Templates
         if (function_exists('et_theme_builder_get_template_layouts')) {
           $layouts = et_theme_builder_get_template_layouts();
           if (!empty($layouts)) {
             if ($layouts['et_header_layout']['override']) {
               $header = get_post($layouts['et_header_layout']['id'])->post_content;
               if (has_shortcode($header, 'et_pb_lottieplayer')) {
                 $diviFlag = true;
               }
             }
             if (!$diviFlag && $layouts['et_body_layout']['override']) {
               $body = get_post($layouts['et_body_layout']['id'])->post_content;
               if (has_shortcode($body, 'et_pb_lottieplayer')) {
                 $diviFlag = true;
               }
             }
             if (!$diviFlag && $layouts['et_footer_layout']['override']) {
               $footer = get_post($layouts['et_footer_layout']['id'])->post_content;
               if (has_shortcode($footer, 'et_pb_lottieplayer')) {
                 $diviFlag = true;
               }
             }
           }
         }
       ```
   
 * Regards,
   Phillip
    -  This topic was modified 2 years, 5 months ago by [declutterdata](https://wordpress.org/support/users/declutterdata/).
    -  This topic was modified 2 years, 5 months ago by [declutterdata](https://wordpress.org/support/users/declutterdata/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Johan Martin Aarstein](https://wordpress.org/support/users/johanaarstein/)
 * (@johanaarstein)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-property-post_content-divi-template-layouts/#post-17193515)
 * Hi,
 * I’m sorry for taking so long to get back to you!
 * In the latest update I’ve added optional chaining to the query, so that it won’t
   fail even if you, say, disable header or footer for your Divi template page. 
   Hope it helps! 😇
 *  Thread Starter [declutterdata](https://wordpress.org/support/users/declutterdata/)
 * (@declutterdata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-property-post_content-divi-template-layouts/#post-17193664)
 * Hi Johan,
 * thanks for your reply. No problem!
   I will look forward to the update and check
   if the problem still occurs.
 * Greetings.
 *  Thread Starter [declutterdata](https://wordpress.org/support/users/declutterdata/)
 * (@declutterdata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-property-post_content-divi-template-layouts/#post-17194204)
 * Hi Johan,
 * update installed and now it works. Great!
 * Your plugin is really important for me as I don’t use Lottie Files directly, 
   but animated JSON files from a third party.
   Your plugin is the only solution 
   I found to use them in WP.Thanks a lot!
 *  Plugin Author [Johan Martin Aarstein](https://wordpress.org/support/users/johanaarstein/)
 * (@johanaarstein)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-property-post_content-divi-template-layouts/#post-17194364)
 * Awesome! Glad to hear 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Warning: Property post_content Divi template layouts’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/am-lottieplayer_204259.svg)
 * [AM LottiePlayer](https://wordpress.org/plugins/am-lottieplayer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/am-lottieplayer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/am-lottieplayer/)
 * [Active Topics](https://wordpress.org/support/plugin/am-lottieplayer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/am-lottieplayer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/am-lottieplayer/reviews/)

## Tags

 * [divi](https://wordpress.org/support/topic-tag/divi/)
 * [divi theme builder](https://wordpress.org/support/topic-tag/divi-theme-builder/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 4 replies
 * 2 participants
 * Last reply from: [Johan Martin Aarstein](https://wordpress.org/support/users/johanaarstein/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/php-warning-property-post_content-divi-template-layouts/#post-17194364)
 * Status: resolved