Archived topic
Make sidebar more narrow
2 replies · Started by Anonymous on May 13, 2016
Hi, Tom! :)
Could you advise, please, how to make my left sidebar more narrow? It has min width of the theme 15% now, but I need less.
Take a look at this page: https://justforex.com/blog/myths-forex-beginners/
That's something that i think is out of the scope of the spacing add-on and the way a sidebar should be used.
Why don't you try something like this for that socialbar:
http://www.jqueryscript.net/social-media/jQuery-Plugin-For-Horizontal-Floating-Social-Share-Bar.html
You can fast test it doing like this on your hooks add-on
On your wp_head hook add this:
<link href="http://www.jqueryscript.net/demo/jQuery-Plugin-For-Horizontal-Floating-Social-Share-Bar/css/floating-share.css" type="text/css" rel="stylesheet">
in your wp_footer hook, this:
<!-- Begin Floating Share -->
<script type="text/javascript">
jQuery(function(){
jQuery("body").floatingShare();
});
</script>
<script type="text/javascript" src="http://www.jqueryscript.net/demo/jQuery-Plugin-For-Horizontal-Floating-Social-Share-Bar/js/jquery.floating-share.js"></script>
<!-- End Floating Share -->
If you plan to use it permanently consider adding the script to your child theme or at least put the jquery.floating-share.js and the floating-share.css where you know it will always be.
Peace :)
I agree with Roberto - that looks like a better solution.
However, you can decrease the sidebar width with something like this:
add_filter( 'generate_left_sidebar_width','generate_custom_left_sidebar_width' );
function generate_custom_left_sidebar_width()
{
return '10';
}
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
