How to Use AJAX in a WordPress Shortcode?
Nice question! But, as your code starts with a bad practice – require_once(‘wp-load.php’); -, I decided to pick one of my working snippets and adapt it. Observations: Differently from your code, no external quotes.txt is being grabbed, here a Post Type is used as source (post), in the method get_random_post There can only be one … Read more