Loading shortcode with ajax
You cannot load a file directly like this: $(‘.homepage__slider’).load(‘wp-content/themes/mytheme/slider.php’); Also note that WordPress loads jQuery in noConflict mode, so the $ alias does not work. If you load a file directly none of the WordPress functions will work. You should be using the AJAX API so that everything loads in WordPress context. You would wrap … Read more