- This topic has 38 replies, 13 voices, and was last updated 5 years, 11 months ago by
Leo.
-
AuthorPosts
-
July 7, 2015 at 12:43 pm #119309
kane
Hi,
thank you for the great theme.
is it possible to make the whole sidebar sticky?
The last element should float to the beginning of the footer-section.
Greetings
July 7, 2015 at 11:59 pm #119391Tom
Lead DeveloperLead DeveloperHi there,
Give this plugin a try: https://wordpress.org/plugins/sticky-menu-or-anything-on-scroll/
The right sidebar element is:
#right-sidebarLeft sidebar is:
#left-sidebarLet me know if you have any questions 🙂
July 8, 2015 at 1:45 am #119406kane
Hi Tom,
thank you for your advice, but the plugin doesnt work properly.
it floats over the footer-section. this doesnt look good.
Maybe there is a solution without plugins?
July 8, 2015 at 10:54 am #119530Tom
Lead DeveloperLead DeveloperNot an easy one unfortunately – you could try integrating a jQuery plugin like this: https://github.com/leafo/sticky-kit
July 8, 2015 at 2:50 pm #119601kane
Hi Tom,
i have tried your solution with the sticky kit, but i didnt work.
Maybe you can give me an advice.
1. copied the jquery.sticky-kit.min.js in my folder “child-theme/js/jquery.sticky-kit.min.js”
2. I have added following code in the footer.php of my child theme
<script type=”text/javascript” src=”js/jquery.sticky-kit.min.js”>
$(document).ready(function(){
$(“#right-sidebar”).stick_in_parent();
});
</script>But still doesnt work….
thanky you
July 8, 2015 at 9:20 pm #119644Tom
Lead DeveloperLead DeveloperAlmost!
Add this to your functions.php:
add_action( 'wp_enqueue_scripts', 'generate_custom_scripts' ); function generate_custom_scripts() { wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/js/jquery.sticky-kit.js', array( 'jquery' ) ); }Then add this to wp_footer (using GP Hooks):
<script> jQuery(document).ready(function( $ ){ $("#right-sidebar").stick_in_parent(); }); </script>July 9, 2015 at 11:09 am #119773kane
Hi Tom,
thank you very much. you are the best
Now it works perfect…
greetings
July 9, 2015 at 11:17 am #119780Tom
Lead DeveloperLead DeveloperAwesome, glad I could help 🙂
January 31, 2016 at 2:09 am #169202Ingrid Wildschut
I have done it all but it’s not working for me.
I’m not working in a child theme is that te problem?Sorry i have make it work…
-
This reply was modified 10 years, 1 month ago by
Ingrid Wildschut.
January 31, 2016 at 10:37 am #169371Tom
Lead DeveloperLead DeveloperAwesome! Glad you made it work 🙂
December 28, 2016 at 12:26 pm #258554Drew
I got this to work as well… however, only if I’m on a blog page.
I created a homepage with a sidebar that I want to be sticky like this?
Any thoughts?
December 28, 2016 at 12:51 pm #258563Drew
Scratch that… it seems to be working on all pages now.
December 28, 2016 at 11:20 pm #258685Tom
Lead DeveloperLead DeveloperGlad you got it working 🙂
December 29, 2016 at 12:30 pm #258900BarnaB
It didn’t work for me :/ Any tiny little chance this could be a new years surprise addon somehow ? 🙂 I was looking for the same without a plugin, but did all the above and didn’t work out :/
December 29, 2016 at 1:14 pm #258923Tom
Lead DeveloperLead DeveloperWhich method did you try? The plugin or the jQuery script?
-
This reply was modified 10 years, 1 month ago by
-
AuthorPosts
- You must be logged in to reply to this topic.