Fatal error: Uncaught Error: Cannot use object of type WP_Post

mail's Avatar


08 May, 2020 06:15 AM


I'm using your plugin and have the fowlling issue after a critical error in the site:

Cosmic Gong Logo

    Cosmic Gong Shop

Fatal error: Uncaught Error: Cannot use object of type WP_Post as array in /home/gong/public_html/wp-content/plugins/new-royalslider/classes/rsgenerator/renderers/DefaultRenderer.php:20 Stack trace: #0 /home/gong/public_html/wp-content/plugins/new-royalslider/classes/rsgenerator/NewRoyalSliderGenerator.php(237): NewRoyalSliderDefaultRenderer->__construct(Object(WP_Post), Array, Array) #1 /home/gong/public_html/wp-content/plugins/new-royalslider/classes/GalleryShortcode.php(102): NewRoyalSliderGenerator::generateSlides(true, true, '1', 'custom', '<div class="rsC...', Array, Array, ' rs-default-tem...', ' rsUni', true) #2 /home/gong/public_html/wp-includes/class-wp-hook.php(289): NewRoyalSliderGalleryShortcode->gallery_shortcode('', Array) #3 /home/gong/public_html/wp-includes/plugin.php(206): WP_Hook->apply_filters('', Array) #4 /home/gong/public_html/wp-includes/media.php(1889): apply_filters('post_gallery', '', Array, 3) #5 /home/gong/public_html/wp-includes/shortcodes.php(343): gallery_shortcode(Array, '', 'gallery') #6 in /home/gong/public_html/wp-content/plugins/new-royalslider/classes/rsgenerator/renderers/DefaultRenderer.php on line 20

Using the Avada Theme. Any hint on how to solve this?

Thank you.

  1. Support Staff 1 Posted by Dmitry Semenov on 08 May, 2020 06:51 AM

    Dmitry Semenov's Avatar


    Possibly you're trying to use posts slider as a gallery. What type of slider have you created and how are you embedding it to your website?

  2. 2 Posted by mail on 08 May, 2020 06:53 AM

    mail's Avatar


    Thank you for the very quick reply. :)

    I'm using it ovewritting the normal gallery of WordPress.

    [gallery royalslider="1" ids="1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729"]

  3. Support Staff 3 Posted by Dmitry Semenov on 08 May, 2020 02:43 PM

    Dmitry Semenov's Avatar

    Please make sure that you use the "gallery" type of slider for [gallery] shortcode.

  4. 4 Posted by mail on 08 May, 2020 03:20 PM

    mail's Avatar


    I believe this is the example that uses the gallery type:
    [gallery royalslider="1" ids="1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729"]

    Am I correct?

    Are you somehow getting complains over Avada theme compatibility? Might be the case.

  5. Support Staff 5 Posted by Dmitry Semenov on 10 May, 2020 06:46 AM

    Dmitry Semenov's Avatar

    When you create a slider (not gallery shortcode, but slider), make sure that you chose "Override [gallery] shortcode" and not "Custom" or "Posts" slider.

    By the shortcode that you posted, I cannot tell what type of slider is #1.

  6. 6 Posted by mail on 10 May, 2020 07:49 AM

    mail's Avatar

    You0re right. Problem solved. :)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac