• Resolved Ivo

    (@ivobirrer)


    Dear Philipp

    I am using your plugin for years now, always without any issues. It simply does what I need and therefore it is one that I hardly would like to miss.

    Out of a sudden it stopped working on all of my pages. Images are not shown, only empty placeholder frames are visible.The site that I have linked with this post is actually not a productive site but my wordpress sandbox. Nevertheless it gives you an impression of the issue. The first gallery is the slick slider, the second has the slick_active=”false” tag set.

    Unfortunately I had to disable it on all my productive page.

    I have also tried to rollback WP to version 5.5.3 without success. I have also disabled all other plugins, again without success. It just looks like the js isn’t working anymore.

    I would be really happy if you could have a look into it and hopefully fix the plugin.

    Best regards
    Ivo

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Ivo

    (@ivobirrer)

    Hi Philipp

    Figured out that I had an issue with the assets/js and assets/css. Got it working on my sandbox installation. I guess it would be more comfortable to place these files into an own plugin folder.

    add_action( 'wp_enqueue_scripts', function() {
    	wp_add_inline_script( 'slick-slider-core', file_get_contents( get_stylesheet_directory() . '/assets/js/slick-slider-custom.js' ) );
    	wp_add_inline_style( 'slick-slider-core-theme', file_get_contents( get_stylesheet_directory() . '/assets/css/slick-slider-custom.css' ) );
    }, 11 );

    How would I need to change the above two lines to point to a folder called own-plugin within the plugin folder? The Idea is that this would be persistent even if one is changing the theme.

    Many thanks for your appreciated assistance.

    Brgds
    Ivo

    • This reply was modified 3 years, 9 months ago by Ivo. Reason: corrections
    Plugin Author Philipp Bammes

    (@tyrannous)

    Hi @ivobirrer,

    First of all, I am glad that you have been using the plugin for so long and have always been satisfied with it.

    Now to your question. I see several issues/things here and I’m trying to break this down into pieces.

    1. The code snippets look like you are talking about the custom code I provided here: https://www.ads-software.com/support/topic/image-images-instead-of-dots-arrows-bottom-right/#post-8966869.
    2. The JavaScript part of the snippet can not really have anything to do with the fact that the images were not displayed. Did you extend the code on your own?
    3. Or is the issue of the images not loading unrelated to your question about how to include the code snippet theme-independently?
    4. You want to put the files in a custom folder inside the Slick Slider plugin folder, right? This is considered bad practice because the entire plugin folder will be overwritten when the plugin is updated, so you would lose the custom folder. (I know there hasn’t been a single update in years, but still.)

    So to answer (parts of) your question: What you want is to create a custom plugin that holds both the JavaScript and CSS file and the PHP logic to render the content inline using the wp_add_inline_script()/wp_add_inline_style() functions. You’ll definitely need some basic knowledge on PHP and the WordPress API. Unfortunately, I can’t be of any help, because this is beyond the scope of the support I can provide here.

    If you need help writing your own plugin, please read the official and very detailed Plugin Handbook. Alternatively, you could sign up for the German or Swiss German WordPress Slack and ask for freelancers who would write the plugin for you.

    I hope that helps you a little bit.

    Thread Starter Ivo

    (@ivobirrer)

    Hi Philipp

    Thank you for your reply. It was late at night when I was writing the previous lines.

    1. Yes, but meanwhile I wrote an own plugin instead of having these lines in the themes function.php. And this worked perfectly for the past few years. In the very same post you gave instructions to create two files (Customs CSS and JS) in the /assets-Folder of the theme. What I would like to do is to move the two files into the folder of my own plugin, but I have no Idea how I have to enqueue them correctly. How would I have to rewrite the above mentione add_acction? Would be great if you could give me a hint.

    2. No, no extension of the code at all. It suddenly stoped working properly. I am still searching for the cause.

    Again: Many thanks for this great plugin.

    Brgds
    Ivo

    Plugin Author Philipp Bammes

    (@tyrannous)

    Hi @ivobirrer,

    1. You basically only have to copy the assets/ folder in your plugin and replace get_stylesheet_directory() with plugin_dir_path( __DIR__ ) in the snippet.
    2. Am I understanding correctly that the images are still not loading on your end? Because for me they load without any problems.
    Thread Starter Ivo

    (@ivobirrer)

    Hi Philipp

    1. Great, that is exactly what I as looking for.any Many thanks!
    2. It perfectly works with my sandbox installation – the one you habe been accessing. I was not able to figure out why it doesn’t work on the productive site. Not sure if we still have a conflict with another plugin.

    You are a great help as always! Just spent you a beer or two.

    brgds
    Ivo

    Plugin Author Philipp Bammes

    (@tyrannous)

    Thanks a lot! Marking as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Slick Slide stopped working’ is closed to new replies.