Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter MercWorks

    (@mercworks)

    I got it!

    It was a silly oversight on my part. Everything was loading fine, but the jQuery that controls the gallery functionality needed to be re-initialized after the AJAX load. One of those “aha!” moments you get in the shower.

    Thanks for all the help!!

    Thread Starter MercWorks

    (@mercworks)

    Update: this issue definitely appears to be related to the gallery shortcode, as adding other content into a post displays without issue.

    So I should rephrase: gallery shortcode is not working on posts loaded via ajax, and solutions like do_shortcode() have not worked. I think this may be related to using a custom gallery filter in functions.php, but I don’t know how to make it all work. Any help would be greatly appreciated!

    Thread Starter MercWorks

    (@mercworks)

    Hi @sjaure! Thanks for the prompt reply.

    AJAX is definitely working okay. If you try the grid view, you’ll see that the AJAX returns data fine and gets the first image of each post using a custom get_first_image function, rather than the_content. In the list view where I’m having the issue, it returns data but does not display the_content.

    So, here’s an example:
    This is the list view, loaded without ajax. Note the full comic, which is being loaded via the_content()

    Here’s the same view, after loading the AJAX content. You can see the gallery shortcode, which is being called by echo $content = get_the_content();, but no comic!

    So, the problem is definitely that the_content() is not displaying when loaded via AJAX. I -suspect- it may be related to the custom gallery filter I’ve got kicking in functions.php, but I really don’t know.

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