• Resolved Emre Vona

    (@emrevona)


    Hi, I am the founder of WP Fastest Cache. I want to execute the javascript action manually after page load. Can you tell me Which js function I need to execute please?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey Emre,

    Nice to meet you!

    To execute the JS, you would just need the sbi_init() function.

    Is this something needed for a certain configuration of your plugin to work with ours? If so we can add an FAQ about it as there are many of our users that also use your plugin.

    – Craig

    Thread Starter Emre Vona

    (@emrevona)

    thank you so much ?? I want to add the images of this plugin to my Lazy Load feature. Our Lazy Load feature load the images. is it cool?

    do you have any hook which edits [instagram-feed]? I want to modify it as below.

    <noscript>
    [instagram-feed]
    </noscript>

    • This reply was modified 4 years, 10 months ago by Emre Vona.
    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey again Emre,

    Yes you can definitely do whatever you need to in order to get our plugin to work with your features! The sbi_init() function has been the way our JavaScript is executed for a long time so it very likely will never change.

    I should tell you a few things though. Making our plugin more compatible with lazy-loading plugins is going to be a priority in upcoming releases. If you have any thoughts you can share them here or contact us on our website:

    https://smashballoon.com/instagram-feed/support/

    Currently our plugin loads a placeholder for all images in the feed and then switches it for the most optimum sized image based on the actual size of the image on the page. This causes a conflict with lazy-loading features so we have a setting to disable this on the “Customize” tab:

    https://snipboard.io/Fr6C4m.jpg

    If it would be beneficial to be able to enable this setting using a hook let me know and I can add it into the plugin.

    For your question about this:
    <noscript>
    [instagram-feed]
    </noscript>

    I’m thinking you are hoping to wrap the entire feed in “noscript” tags? Would it work to add the tags before and after the generated HTML from the shortcode. We don’t currently have a way to do this with hooks but it would make sense to add these in for something like this.

    Let me know if you have more questions!

    – Craig

    Thread Starter Emre Vona

    (@emrevona)

    I do not replace the images. I just load the html source with lazy load and execute sbi_init() function.

    but I recommend you to add some hook. For example; “before short code” and “after short code” to detect your short code or html source.

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Ahh I see. Sounds like that will work great.

    Yes I’ve made a note to add those hooks as I’m sure others might be interested in them as well.

    Thread Starter Emre Vona

    (@emrevona)

    thanks ??

    Thread Starter Emre Vona

    (@emrevona)

    I have an idea. does it cause any issue?

    1. I replace the id as below.
    <div style=”display:none;” data-wpfcif-id=”sb_instagram”>

    2. Later I add “id” attribute and run .show() and sbi_init()

    • This reply was modified 4 years, 10 months ago by Emre Vona.
    • This reply was modified 4 years, 10 months ago by Emre Vona.
    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Yeah I don’t think it would cause an issue though I might mention that the JavaScript for the feeds uses the “sbi” class to detect if a feed is on the page. The “sb_instagram” ID is only used for CSS.

    That might not matter to what you are doing though I suppose.

    Thread Starter Emre Vona

    (@emrevona)

    thank you.

    Thread Starter Emre Vona

    (@emrevona)

    I have another idea ?? If the shortcode is added as below, it can be loaded via Lazy Load of wp fastest cache.

    <noscript data-type=”wpfc”>[instagram-feed]</noscript>

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Ahh yeah that seems pretty straightforward.

    We are going to release an update next week. We are adding support for a few hooks that you can use for this ‘sbi_before_feed’ and ‘sbi_after_feed’. Some examples:

    add_action( 'sbi_before_feed', 'sbi_custom_before_feed', 10, 2 );
    add_action( 'sbi_after_feed', 'sbi_custom_after_feed', 10, 2 );
    Thread Starter Emre Vona

    (@emrevona)

    wow ?? it is better. if you tell me know when you release a new version, it makes me so happy.

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    It should be coming out today! The Pro version already has these changes.

    Thread Starter Emre Vona

    (@emrevona)

    thank you ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Loading Images’ is closed to new replies.