How to use the alnp-post-url trigger
-
Hi,
I might be close to getting the auto load recent / related posts working, but I think I’m missing something about the alnp-post-url trigger.
Here’s the code I have now:
$.ajax( { type: "post", dataType: "json", url: ajax_object.ajax_url, data: { 'action': 'load_recent' }, success: function(response){ $('body').on( 'alnp-post-url', function( e, post_count, post_url ) { $.each(response, function (index, value) { post_count = index + 1; post_url = JSON.stringify(value); }); }); }, });
So basically, I’m using an Ajax call to return recent post URLs from a php function. That part is working, but when calling the alnp-post-url trigger using those URLs, the normal posts are still being loaded and not the ones returned by my ajax call.
Any help would be appreciated.
Thank you.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘How to use the alnp-post-url trigger’ is closed to new replies.