Support » Theme: GeneratePress » Error when queuing function

  • Resolved gmorrison


    I insert this code in GP’s child theme function.php:

    function LoadSlickOnHomePage() {

    if (is_page(3347)) {

    wp_enqueue_script( ‘load_Slick_frontend_js’, plugins_url(‘elementor/assets/lib/slick/slick.min.js’), array(‘jquery’), ”, true );

    wp_enqueue_style( ‘load_Slick_frontend_css’, get_stylesheet_directory_uri(‘/slick/slick.css’) );

    wp_enqueue_style( ‘load_Slick_frontendtheme_css’, get_stylesheet_directory_uri(‘/slick/slick-theme.css’) );


    add_action(‘wp_enqueue_scripts’, ‘LoadSlickOnHomePage’);

    While the JS file does load, the 2 CSS files don’t get loaded because the browser makes a call to :

    Reason is 403 forbidden, no directory listing.

    Shouldn’t the call be made instead to style.css ?

    Please help, thanks!!

    • This topic was modified 10 months, 2 weeks ago by  gmorrison.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Tom


    Hi there,

    Did you get this working? The topic is set to resolved.

    Let me know 🙂

    yeah, solved it after a coffee and another look at it 🙂

    many thanks, you’re awesome Tom !

    note for self:
    argument for “get_stylesheet_directory_uri” function is wrong, path needed correction

    Theme Author Tom


    Awesome, glad you got it working 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error when queuing function’ is closed to new replies.