Title: Shortcode doesnts render in ajax response
Last modified: June 29, 2021

---

# Shortcode doesnts render in ajax response

 *  Resolved [olgamm](https://wordpress.org/support/users/olgamm/)
 * (@olgamm)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/shortcode-doesnts-render-in-ajax-response/)
 * Hello,
 * i have posts that has a gallery shortcode in the content and when I’m loading
   more posts with ajax, the shortcode doesn’t render and it’s displayed like a 
   text. I saw in a previous thread that was a version issue but the thread was 
   from 2 years ago.
 * I have the latest version of the plugin (Free version)
 * Thanks in advance

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

 *  [Asya Gabrilyan](https://wordpress.org/support/users/asyag/)
 * (@asyag)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/shortcode-doesnts-render-in-ajax-response/#post-14609951)
 * Dear [@olgamm](https://wordpress.org/support/users/olgamm/),
    Thank you for the
   inquiry.
 * Can we have the gallery page to see the issue from your end?
 * Sincerely,
 *  Thread Starter [olgamm](https://wordpress.org/support/users/olgamm/)
 * (@olgamm)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/shortcode-doesnts-render-in-ajax-response/#post-14610135)
 * Hello
 * i have created a test page for you to see,
    Link: [https://bit.ly/3hdZ34Q](https://bit.ly/3hdZ34Q)
 * i have a custom query and i have created a load more for pagination with ajax.
   The posts inside the_content() have the gallery element only, so when Im calling
   the the_content() the shortcode doesn’t get rendered.
 * if i do it without an ajax pagination the shortcodes get displayed normally
 * Many thanks
 *  Thread Starter [olgamm](https://wordpress.org/support/users/olgamm/)
 * (@olgamm)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/shortcode-doesnts-render-in-ajax-response/#post-14618411)
 * Hello [@asyag](https://wordpress.org/support/users/asyag/)
 * any idea why this is happening?
 * Thanks in advance
 *  Thread Starter [olgamm](https://wordpress.org/support/users/olgamm/)
 * (@olgamm)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/shortcode-doesnts-render-in-ajax-response/#post-14619540)
 * Well, i solve it in a way,
 * in the file functions.php in my function that i get the content, instead calling
   the function “the_content()”
    im getting the id of the gallery of current post
   and then im calling the “photo_gallery” function like this :
 * if( function_exists(‘photo_gallery’) ) {
    echo photo_gallery($IdOfGallery); }
 * so this is a workaround for me.
    But the issue is still an issue, it will be 
   great if you can solve it for future issues.

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

The topic ‘Shortcode doesnts render in ajax response’ is closed to new replies.

 * ![](https://ps.w.org/photo-gallery/assets/icon-256x256.png?rev=2068745)
 * [Photo Gallery by 10Web - Mobile-Friendly Image Gallery](https://wordpress.org/plugins/photo-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photo-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photo-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/photo-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photo-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photo-gallery/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [olgamm](https://wordpress.org/support/users/olgamm/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/shortcode-doesnts-render-in-ajax-response/#post-14619540)
 * Status: resolved