• Resolved rickykpg

    (@rickykpg)


    Hello,

    Thanks for making this great plugin, it was the only one that worked with my theme. However I noticed that the plugin was missing two essential settings, offset from the top and refresh rate.

    I was in the process of adding offset from the top when I stumbled across Simon Barnett’s post in this topic which works perfectly so I added it and the refresh rate setting and want to share with the community so others can benefit from these additions.

    Youdaman feel free to include my edit (refresh rate) if it passes your examination. Simon Barnett also said (in the thread linked above) it would be ok to include his addition as well.

    I’m still fairly new to coding so if an experienced coder also wanted to take a look I would appreciate it.

    Replace the code in sticky-element.php with this.

    https://pastebin.com/iDsdL8u6

    EDIT:
    Realized I forgot to change the unit type from px to ms. This won’t affect anything but to make the change replace

    <td><input type="text" name="sticky_element_refreshrate" value="<?php echo get_option('sticky_element_refreshrate'); ?>" placeholder="e.g. 500" />px</td>

    with

    <td><input type="text" name="sticky_element_refreshrate" value="<?php echo get_option('sticky_element_refreshrate'); ?>" placeholder="e.g. 500" />ms</td>
Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter rickykpg

    (@rickykpg)

    I ended up making some changes and while it’s minor, I wanted to share it. I cleaned up the options menu a bit and added a description and general usage info for each setting that should clear up any confusion anyone might have.

    Again Youdaman, feel free to include my changes if you’d like.

    Replace the code in sticky-element.php with this.
    https://pastebin.com/4sRL1Q2z

    Wonderful Thanks.

    Plugin Author Youdaman

    (@youdaman)

    Excellent work rikcykpg, thank you very much mate! Nice enhancement ??

    Thanks, rickykpg!

    The “offset” feature is just what I was looking for, too!

    Question: Do we know if the new code you included is still working (as of today 4/14/16)?

    That is, sticky element works for me “out of the box” but when I replace it with your code and set the offset in the Options, not only does it not offset but for whatever reason it doesn’t stick anymore either (as far as I can tell – have inspected it and tried to figure it out before posting here).

    I am using WordPress 4.4 (4.5 just came out two days ago but Visual Composer wasn’t quite ready for it so I just delayed till they released their update).

    No rush on reply (if at all) but thanks again for your work, Youdaman, and to rickykpg – thank you so much as well!

    Sounds like an interesting enhancement. Did you consider implementing this into Sticky Element?

    It would also be nice if it would be possible to have multiple sticky elements on the same page. I don’t know if this is currently possible? For instance, if you have a sidebar with 3 widgets and you want 2 widgets to be sticky when a user scrolls down. Is this possible?

    Best regards,
    Michael

    Plugin Author Youdaman

    (@youdaman)

    I’ve not yet integrated rickykpg’s code into the plugin, and a few people have asked about multiple elements.

    I guess the easiest way for me to implement this would be to create a textarea that lets you specify multiple elements via separate lines, ie one sticky element (and its settings) per line.

    If I have some time soon I’ll have a crack at it ??

    Hi Youdaman,

    Something like that would be great(!)

    We are totally thankful/pleased with what you have, of course, but if an offset field and multiple elements fields might be on the horizon, that would be great, too.

    Again, perhaps another option for the “Pro” version(?).

    I am going to go ahead and say thanks anyhow on a much deserving plugin and go Pro (with no expectation for you to ever implement the above). This has helped me in 2 projects and it’s a way to say, “Thanks!”.

    So, “Thanks, Youdaman!” Thanks for even taking it this far. ??

    Thread Starter rickykpg

    (@rickykpg)

    Sorry for the late reply, running 4.5.1 on the site this plugin is installed on and everything works fine. Not quite sure why it doesn’t work for you Caleb Weeks. I would double-check sticky-element.php and make sure it matches what I posted.

    Thanks for taking the time to reply, rickykpg. We’ll figure it out! Thanks again for the code, as well, and for taking the time to share it with all of us. Thanks everyone ??

    Thread Starter rickykpg

    (@rickykpg)

    I would double-check your settings and make sure each setting is filled out. Are you by chance running both versions of the plugin at the same time?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Offset From The Top And Refresh Rate Added’ is closed to new replies.