-
-
Hello,
I created a single portfolio item with a floating sidebar on the left.
I also activated the sticky header.
When I scroll down the single portfolio page the floating sidebar is now too much at the top, covered by the sticky menu.
Where can I change this moving position of the floating sidebar?
As the page is not visible to the public yet, I could give you login credentials?
Thanks for Help
Bernd -
Hello,
Please go to file: js\main.js and find these lines:
function codeless_single_portfolio_floating(){ "use strict"; var $sidebar = $(".fixed_sidebar"), $window = $(window), offset = $sidebar.offset(), topPadding = 15;
Edit the
topPadding = 15;
value to 200 or more. Save and refresh.Best regards!
-
Hi Mihaila,
that works great!
Is there a chance to integrate this into the child theme somehow, so that I dont have to do this modification again, when you update the theme?
Thank you
Bernd -
Hello,
Sorry for the late reply.
You should add this code:<?php // Register Script function custom_main_js() { wp_deregister_script( 'specular' ); // This is the handle used by the main theme's functions.php for main.js wp_register_script( 'specular-child', '/wp-content/themes/specular-child/js/main_custom.js', array( 'specular' ), false, false ); // This is the URL to your child theme's custom js file and a handle we've given it wp_enqueue_script( 'specular-child' ); } // Hook into the 'wp_enqueue_scripts' action add_action( 'wp_enqueue_scripts', 'custom_main_js' );
into your child’s theme function.php file. Please read here, for more information.
Best regards!
-
Hi Mihaila,
seems complicated. I see that there is “Custom JS Code” in WordPress/Specular/General Options
Could I not put the changed code simply in here and it will not be affected from a theme update?
Thanks
Bernd -
Hello,
Sorry but in this case it will not work from the Custom js code.
Best regards!
-
You must be logged in to reply to this topic.