How to properly implement a custom ajax How to properly implement a custom ajax wordpress wordpress

How to properly implement a custom ajax


You should probably read:

You should pass PHP variables to your javascript files using wp_localize_script.

Even if you don't do it that way, you shouldn't need to hack the main page templates just to serve specific content -- create a one-off page, then make a specific template for it. Then you can use that page's URL as your ajax endpoint.

But if what you really need to do is run Rev Slider's shortcode (and the Parallax thing if it has one too) somewhere other than a page:


Do you need help with this still? I think the revolution slider's support team nailed it with the statements

just add the slider's shortcode to a regular page/post

and

all you really need to do is pull in the slider as page/post content

So, use the slider on your WordPress page/post through the shortcode, [shortcode]. Then reference the $_GET[] and/or $_POST[] array elements in php (or javascript, however you're doing it) as needed.