Ajax request
-
Hi,
First off, great plugin.I am trying to launch the shortcode in ajax, only when the user gets to the bottom of the page (where the gallery is echoed in the template file, grabs image dynamically), the only issue is that the shortcode is rendered, but every height is set to 0 and therefore nothings shows up (but the html is all there when you check view source).
Maybe a conflicting AJAX call?
Here is my SCRIPT:
$.ajax({ type : 'POST', url : frontendajax.ajaxurl, data : { 'action': 'galbottom' }, success: function(data) { $('.single-post .galleryBottom').append(data); } });
HEre is my function:
add_action( 'wp_ajax_galbottom', 'galbottom_callback' ); add_action( 'wp_ajax_nopriv_galbottom', 'galbottom_callback' ); function galbottom_callback() { echo do_shortcode('[gallery size="medium_large" link="file"]'); die; }
OR Do you think of any lazy load function to render only when needed.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Ajax request’ is closed to new replies.