HTML and CSS codes for your Blogger/site Part One
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
Every widget is finished like this. Just before it says that, place this code:
<b:else/>
<style type='text/css'>
# {display:none;}/*to hide empty widget box*/
</style>
</b:if>
HOWEVER, where the # is you need to write what widget you're editing e.g HTML1.
So it should look something like this:
Don't worry if it these codes are very far away from each other, it all depends on how much code is in your widget.
HTML How to have a widget everywhere but the homepage
This information was found at Sneeit
Again, head to your HTML, click 'jump to widget' select the widget you need to jump to, e.g HTML1. Your posts widget is classed as 'Blog1'.
Let's say you want to hide all your posts from the main page. To do this, you find the part where it says <b:includable id='main'>
After this part of the code, enter
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:remove/>
</b:if>
It should look something like this:
HTML How to show a widget on a specific page/post only
This information was found at BloggerSentral
Again, head to your HTML, click 'jump to widget' select the widget you need to jump to, e.g HTML1. Your posts widget is classed as 'Blog1'.
Let's say you want to hide a widget from a specific page, to do this, you find the part where it says <b:includable id='main'>
After this part of the code, enter
<b:if cond='data:blog.url == "PUT_URL_HERE"'>
Then simply scroll down to the part just before it says </b:includable>
Just before it says that, place this code:
<b:else/>
<style type='text/css'>
# {display:none;}/*to hide empty widget box*/
</style>
</b:if>
HOWEVER, where the # is you need to write what widget you're editing e.g HTML1.
It will look something like this, however remember to change what I have underlined to your own widget name and the URL of your choice:
HTML How to hide a widget on a specific page/post only
This information was found at BloggerSentral
Head to your HTML, click 'jump to widget' select the widget you need to jump to, e.g HTML1. Your posts widget is classed as 'Blog1'.
Let's say you want to hide all your posts from the main page. To do this, you find the part where it says <b:includable id='main'>
After this part of the code, enter
<b:if cond='data:blog.url == "PUT_URL_HERE"'>
<b:remove/>
</b:if>
It will look something like this, however remember to change what I have underlined to the URL of your choice:
HTML How to move locked widgets in the Layout
As you may realise, some widgets can't be moved in the layout. Simple code can fix that.
Head to your HTML, Jump to your widget, and where it says Locked = 'true', change that to false, it should now look like this:
<b:widget id='Label1' locked='false' title='Labels' type='Label'><b:includable id='main'><b:if cond='data:title'></b:if><h2><data:title/></h2><div class='widget-content'><select style='width:100%' onchange='location=this.options[this.selectedIndex].value;'><option>Your text here</option><b:loop values='data:labels' var='label'><option expr:value='data:label.url'><data:label.name/>(<data:label.count/>)</option></b:loop></select><b:include name='quickedit'/></div></b:includable></b:widget>
<button type="button"><a href="Your link">Your button's name</a></button>
<button onclick="history.back()">Go Back</button>
How to make a sticky back to top button
<!--New Blogger Widget back to top widget Start--><script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'></script><script type='text/javascript'>$(function(){$(window).scroll(function(){if($(this).scrollTop()!=0){$("#nbw-top").fadeIn()}else{$("#nbw-top").fadeOut()}});$("#nbw-top").click(function(){$("body,html").animate({scrollTop:0},800);return false})});</script><a href="http://newbloggerwidget.blogspot.com"></a><a id='nbw-top' style='display: none; position: fixed; bottom: 1px; right:0%; cursor:pointer;font:12px arial;'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2lfK1LtKsfiekbAXOlDHqILWKecx2cDkcnx0yyMXil-kXgnSCqesc7Ua8-3fTSxLwjBJ5C9taiCk3kpPAT7RwebcMfs68D5xTfQ7TMXdbefPI-a2lEXhSHvFGEN0tnF2yoSuY1JyuQBw/s1600/newbloggerwidget-back-to-top-1.png' width="50px" height="50px"/></a><!--New Blogger Widget back to top widget End-->
At the end of your blog, it should now look like this:
.boxed {border: 1px solid black ;} .centered-top-container.sticky {display: none;}
After making sticky buttons, your Blog could make every HTML become sticky. If this happens you first need to find the name of your HTML widget.
To find the name if you added your button to your layout via the HTML widget, you need to follow these steps.
Once you know what your widget is called, simply head to your CSS edit page, and add this code:
#YOURWIDGET { position: inherit;}
Don't forget to save your edits!
I do hope you've found something useful from this page. Leave me a comment below if something isn't working right! Thank you!
The next thing I suggest you read is HTML and CSS codes for your Blogger - Part Two
I'd love feedback about this Blog's coding series. Feel free to leave me some!
ReplyDelete