• Hi,

    I’ve seen this issue being addressed over and over again, but i haven’t come across a 100% working solution for everyone that is trying to create custom AJAX calls on content that contains shortcodes. Some people suggest making the AJAX call trough wordpress frame (trough admin ajax)

    https://codex.www.ads-software.com/AJAX_in_Plugins

    while others say its better to include core wordpress functionalities in your own file (including wp-load.php in your php file)

    https://www.ads-software.com/support/topic/running-shortcode-inside-ajax-request?replies=9#post-5324569

    I have tried both versions, but actually none of the mentioned techniques work – meaning, the shortcodes aren’t parsed.

    F.ex. i’m trying to ‘load more posts’. Content in the posts is created with DIVI builder. Shortcodes in the response are however, unparsed.
    The only way the response is correct is in the second example, but if i include the wp-blog-header.php instead of wp-load.php. But if i do include the wp-blog-header.php, i get a 404 error (im guessing because of security reasons, cause the actual response is in this case correct; still not displayed as its a 404).

    Is there a reliable way to achieve displaying shortcodes trough AJAX? I mean, it can’t be THAT hard if there are thousand AJAX plugins that work correct on this principle.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Shortcodes in ajax – again’ is closed to new replies.