Initialize Royal Slider on AJAX Pages

Peter Mandell's Avatar

Peter Mandell

18 Mar, 2013 06:54 PM

My WordPress theme loads pages via AJAX. I have successfully loaded the slider through "echo get_new_royalslider($sliderID)" but the slider is still not initializing. How can I get the correct jQuery code (including the specific options for the given slider) and run it after the AJAX is complete. Any help would be much appreciated! Thanks!

Showing page 2 out of 2. View the first page

  1. 31 Posted by edgardo on 20 May, 2014 03:11 PM

    edgardo's Avatar

    Hello shir,

    Dmitry pointed me toward this discussion and I found your code.

    It works partially for me, It actually shows the slider but overrides the settings.

    Am I missing something?

    I pasted the code directly to the functions.php file and I'm using the [fire_royalslider id="1"] shortcode.

    Thank you for your help.

  2. Support Staff 32 Posted by Dmitry Semenov on 21 May, 2014 08:58 AM

    Dmitry Semenov's Avatar

    @edgardo, it shouldn't override the settings, please link to the page that you're working on (open separate private discussion).


  3. 33 Posted by shir on 22 May, 2014 05:14 AM

    shir's Avatar


    If you could link to your page, or even if you could open a new user for me so I can check this, I would love to assist.

  4. 34 Posted by edgardo on 22 May, 2014 05:18 AM

    edgardo's Avatar

    Hello shir and Dmitry,

    Thanks for your response. I have managed to make it work.

    I combined the solution provided by shir in code, and disabled some options from the theme.

    Here’s the site:

  5. 35 Posted by hello on 04 Jun, 2014 12:13 PM

    hello's Avatar

    I'm also trying to get the slider to work in an ajax loaded site but I'm having issues.

    Using the function above the slider shows up fine but when visiting another page and then navigating back to the page with the slider, the settings of the slider revert to the default settings.

    Could anyone give me some pointers on what could possibly be the cause please.

    The site is still hosted locally on my machine so unfortunately I can't grant you access to login and have a look.

  6. Support Staff 36 Posted by Dmitry Semenov on 05 Jun, 2014 12:15 PM

    Dmitry Semenov's Avatar

    ^ please open separate discussion and link to page that you're working on, take a look closer at examples, posted in this discussion.


  7. 37 Posted by hello on 05 Jun, 2014 12:35 PM

    hello's Avatar

    The problem I'm describing is exactly the same as the following one specified by the user Edgardo and referencing the

    "It works partially for me, It actually shows the slider but overrides the settings. Am I missing something?"

    I'll open a new discussion though.

  8. 38 Posted by Leo on 15 Jul, 2014 09:36 AM

    Leo's Avatar

    This comment was split into a new discussion: Change the fitInviewport option

    Hi Dmitry,

    Could you give some advise on how to recreate/reinit or change the fitInviewport settings on window resize? thanks

  9. 39 Posted by italo1961 on 14 Aug, 2014 09:04 AM

    italo1961's Avatar

    Hi, great solution works for me!

    I have a question (sorry i'm newbe)

    if you have more sliders... this is correct?


  10. Support Staff 40 Posted by Dmitry Semenov on 14 Aug, 2014 03:30 PM

    Dmitry Semenov's Avatar

    @italo1961 no, correct syntax would be:


    Though, if skin and template of your sliders is the same, you may leave just one call. Also, you may just override default WordPress [gallery] once

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac