royalSlider is not a function

sietse's Avatar

sietse

04 Feb, 2017 03:22 PM

Hello,

I get an error when trying to embed royalSlider in the header.php from the Enfold theme.

JQMIGRATE: Migrate is installed, version 1.4.1
(index):354 Uncaught TypeError: $(...).royalSlider is not a function
    at HTMLDocument.<anonymous> ((index):354)
    at i (jquery.js?ver=1.12.4:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
    at Function.ready (jquery.js?ver=1.12.4:2)
    at HTMLDocument.K (jquery.js?ver=1.12.4:2)
(anonymous) @ (index):354
i @ jquery.js?ver=1.12.4:2
fireWith @ jquery.js?ver=1.12.4:2
ready @ jquery.js?ver=1.12.4:2
K @ jquery.js?ver=1.12.4:2
(index):256 GET http://www.sieber.nl/wp-content/themes/enfold/images/layout/linkedin-bw.png 404 (Not Found)
(index):257 GET http://www.sieber.nl/wp-content/themes/enfold/images/layout/facebook-bw.png 404 (Not Found)
(index):323 GET http://www.sieber.nl/wp-content/themes/enfold-child/images/layout/breadcrumb-arrow.png 404 (Not Found)

What can be the issue?

  1. Support Staff 1 Posted by Dmitry Semenov on 04 Feb, 2017 07:49 PM

    Dmitry Semenov's Avatar

    Hello,

    If you're including slider manually via PHP - make sure that files are included (on RoyalSlider Settings page) http://help.dimsemenov.com/kb/wordpress-royalslider-tutorials/wp-in...

    It would help if you link to the page with the issue.

  2. 2 Posted by sietse on 05 Feb, 2017 03:40 PM

    sietse's Avatar

    Thanks Dmitry that worked!

    Is it possible to have the slider only embedded on the homepage?

    For example:
    <?php echo get_new_royalslider(1, homepage); ?>
    or
    <?php if ( is_home() && function_exists('get_new_royalslider') ) { get_new_royalslider(1); } ?>

    Thanks!

  3. 3 Posted by sietse on 05 Feb, 2017 03:56 PM

    sietse's Avatar

    Another question:
    Is it possible to set an inner grid when using the slider full width?

    See example of Revolution slider.

    Thanks!

  4. Support Staff 4 Posted by Dmitry Semenov on 05 Feb, 2017 05:20 PM

    Dmitry Semenov's Avatar

    Is it possible to have the slider only embedded on the homepage?

    Your second block of code seems to be correct, you're just missing echo before get_new_royalslider method.

    Is it possible to set an inner grid when using the slider full width?

    You may use CSS media queries to set any size to slider at any screen width, there is example here http://help.dimsemenov.com/kb/royalslider-jquery-plugin-faq/how-to-...

  5. 5 Posted by sietse on 05 Feb, 2017 05:33 PM

    sietse's Avatar

    Thanks for your quick response!

    This is also not working:
    <?php if ( is_home() && function_exists('get_new_royalslider') ) { echo get_new_royalslider(1); } ?>

    But thanks anyway!

  6. Support Staff 6 Posted by Dmitry Semenov on 06 Feb, 2017 12:09 PM

    Dmitry Semenov's Avatar

    1) When you add just:

    echo get_new_royalslider(1);
    

    does it print slider?

    2) When you add just:

    <?php 
    if ( is_home() && function_exists('get_new_royalslider') ) { 
      echo "<h1>Hello world</h1>";
    } ?>
    

    does it print "hello world"?

  7. 7 Posted by sietse on 06 Feb, 2017 01:32 PM

    sietse's Avatar

    Hello Dmitry,

    It shows with the code in 1) and it does not print 'Hello world' 2)

  8. Support Staff 8 Posted by Dmitry Semenov on 06 Feb, 2017 07:43 PM

    Dmitry Semenov's Avatar

    Does it print "hello world" with just:

    if ( is_home() ) { 
      echo "<h1>Hello world</h1>";
    }
    

    ?

    Where exactly are you adding the code?

  9. 9 Posted by sietse on 07 Feb, 2017 03:08 PM

    sietse's Avatar

    Hello Dmitry,

    No, that code is not working as well.

    This is the test website http://www.sieber.nl/kasteel/ <http://www.sieber.nl/kasteel/>

    Hereby the placement of the code in the header.

  10. Support Staff 10 Posted by Dmitry Semenov on 07 Feb, 2017 06:48 PM

    Dmitry Semenov's Avatar

    I'd recommend to ask your theme developer on how to print some text just on its homepage, as the issue seems to be unrelated to the slider.

  11. 11 Posted by sietse on 08 Feb, 2017 08:02 AM

    sietse's Avatar

    Thank you very much Dmitry for your help!
    I will ask the theme developer what the problem is.

  12. 12 Posted by sietse on 08 Feb, 2017 03:22 PM

    sietse's Avatar

    Hello Dmitry,

    I know how to print the slider on the homepage now, it is this code:
    <?php if(is_front_page()) { echo get_new_royalslider(1); } ?>

    I like to accomplish something like this with RoyalSlider:
    http://www.buitenplaatsamerongen.nl/ <http://www.buitenplaatsamerongen.nl/>

    Is that possible?

    Thanks!

  13. Support Staff 13 Posted by Dmitry Semenov on 08 Feb, 2017 03:41 PM

    Dmitry Semenov's Avatar

    There are multiple slideshows on the page that you linked, please be more specific on what exactly feature do you need and which part you don't know how to implement.

  14. 14 Posted by sietse on 08 Feb, 2017 04:23 PM

    sietse's Avatar

    Thanks for opening my eyes! I know how to do it now ;-)

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • Schermafbeelding_2017-02-04_om_16.21.15.png 28.1 KB

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

Generic

? 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