How to Make Sticky Bar in WordPress Thesis Theme

By | December 27, 2013

All visible things in webpage will be disappear, when we scroll down. Sticky bar in a webpage will stick to the webpage and fixed in a constant position. Here is the tutorial for how to Make Sticky Bar in WordPress Thesis Theme. In this sticky bar, it will have blog name, facebook like, google + button, search bar and go to top button. This bar will stick to the top of the webpage. This sticky bar will make user interface much better and user can easily navigate to home page.

 

Sticky Bar in WordPress Thesis Theme

Sticky Bar in WordPress Thesis Theme

 

Step 1: Wordpress Admin -> Thesis(Left Menu bar) -> Skin Edior -> HTML Editor

Step 2: Add Textbox and give name as “sticky”

Step 3: WordPress Admin -> Thesis(Left Menu bar) -> Skin Content

Step 4: Put the following code in “sticky” textbox

Sticky – Text Box
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<div id="sticky_outer">
<div id="sticky_inner">
<ul id="stickyleft">
<li class="logo"><a href="/blog/#top">Freeze Coders</a></li>

<li class="fb">
<div><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Ffreezecoders&amp;send=false&amp;layout=button_count&amp;width=85&amp;show_faces=false&amp;action=like&amp;colorscheme=dark&amp;font&amp;height=21" style="border:none; overflow:hidden; width:85px; height:21px; margin-left:38px" allowtransparency="true" frameborder="0" scrolling="no"></iframe></div>
</li>

<li class="gplus1">
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<div class="gplus">
<g:plusone size="medium" annotation="none" href="http://www.freezecoders.com/"></g:plusone>
</div>
</li>
</ul>

<ul id="stickyRight">
<li class="searchbox">
<form method="get" action="http://www.XXXX.com/?s="><p>
<input class="sticky_input" type="text" value="Text to Search" name="s" id="s" onfocus="if (this.value == 'Text to Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Text to Search';}" />
</p>
</form>
</li>

<li class="btt"><a href="#top" title="Back to top"></a></li>
</ul>
</div>
</div>

 

Step 5: WordPress Admin -> Thesis -> Custom CSS and Put the following code

Custom CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#sticky_outer {
position: fixed;
z-index: 2;
top: -110px;
width: 100%;
height: 45px;
line-height: 45px;
color: rgb(255, 255, 255);
border-top: 1px solid rgb(72, 72, 72);
border-bottom: 2px solid rgb(0, 0, 0);
background: #000;
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.6);
}
#sticky_inner {
width: 970px;
margin: 0px auto;
}
#stickyleft {
float: left;
width: 68%;
}
.sticky_input
{
padding: 5px 10px;
border-radius: 19px;
border: 1px solid #000;
color: #C5C5C5;
outline: 0px;
box-shadow: inset 1px 1px 4px #6D6D6D;
-moz-box-shadow: inset 1px 1px 4px #6D6D6D;
-webkit-box-shadow: inset 1px 1px 4px #6D6D6D;
-o-box-shadow: inset 1px 1px 4px #6D6D6D;
-ms-box-shadow: inset 1px 1px 4px #6D6D6D;
}
#stickyRight {
float: left;
width: 25%;
}
#stickyleft li {
margin-right: 1%;
}
#sticky_inner li {
list-style: none outside none;
float: left;
}

#stickyleft .logo a {
width: 225px;
color: rgb(255, 255, 255);
font-family: "Droid Sans",Helvetica,Arial,sans-serif;
font-weight: bold;
text-transform: uppercase;
display: block;
height: 35px;
}
.fb
{
margin: 11px 0 0 0;
}
.gplus1
{
margin: 2px 0 0 0;
}
.btt a
{
display: block;
color: rgb(204, 204, 204);
margin: 9px 0px 0px 20px;
background: none repeat scroll 0% 0% rgb(255, 255, 255);
padding: 0px 11px;
border-radius: 55px;
height: 29px;
line-height: 25px;
}

 

Step 6: WordPress Admin -> Thesis -> Manage Boxes -> HTML Head Editor -> Head Scripts

Place the following code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
</script>
<script type="text/javascript">
$(function(){
var listval = $('#sticky_outer')[0].offsetTop;
$(document).scroll(function() {
var topval = $(document).scrollTop();
if(topval >= 130){
$('#sticky_outer').css('top','0px');
} else {
$('#sticky_outer').css('top','-110px');
}
});
});
</script>

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

goldurn-exsolve