Кнопки социальных сетей

HTML

Этот код ставится в то место, где Вам необходимо видеть кнопки.

Это могут быть файлы:

  • indx.php
  • single.php — записи;
  • page.php — страницы.

Так-же его можно вставить в виджет, в запись или на страницу ( в редакторе HTML )

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div class="buttons">
<a target="blank" rel="nofollow noopener noreferrer" href="https://vk.com/share.php?url=&lt;?php the_permalink(); ?&gt;" class="vkontakte">VK</a>
</div>
 
<div class="buttons">
<a target="blank" rel="nofollow noopener noreferrer" href="http://www.odnoklassniki.ru/dk?st.cmd=addShare&amp;st.s=1&amp;st._surl=&lt;?php the_permalink(); ?&gt;&amp;title=&lt;?php the_title(); ?&gt;" class="odnoklassniki">Оk</a>
</div>
 
<div class="buttons">
<a target="blank" rel="nofollow noopener noreferrer" href="http://www.facebook.com/sharer.php?u=&lt;?php the_permalink(); ?&gt;" class="facebook">Fb</a>
</div>
 
<div class="buttons">
<a target="blank" rel="nofollow noopener noreferrer" href="http://www.twitter.com/sharer.php?u=&lt;?php the_permalink(); ?&gt;" class="twitter">Tw</a>
</div>
 
<div class="buttons">
<a target="blank" rel="nofollow noopener noreferrer" href="https://plusone.google.com/_/+1/confirm?hl=ru&amp;url=&lt;?php the_permalink(); ?&gt;" class="google">G+</a>
</div>

CSS

Этот код нужно вставить в конец файла style.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
/* --- Социальные кнопки ---------------------------------------------------- */
 
.buttons {
height: 36px;
overflow: hidden;
width: 120px;
float: left;
}
a.vkontakte {
 
display: block;
line-height: 36px;
height: 36px;
width: 100%;
overflow: hidden;
text-align: center;
text-decoration: none;
font-weight: bold;
text-shadow: 0 100px 0 #FFF,1px 76px 10px #000;
color: #FFF;
background: #507299;
border-right: 2px solid #FFF;
border-left: 2px solid #FFF;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
a.vkontakte:hover {
text-shadow: 0 36px 0 #FFF, 1px 37px 20px #FFF;
margin-top: -36px;
height: 120px;
background: #222;
}
a.odnoklassniki {
 
display: block;
line-height: 36px;
height: 36px;
width: 100%;
overflow: hidden;
text-align: center;
text-decoration: none;
font-weight: bold;
text-shadow: 0 120px 0 #FFF,1px 76px 10px #000;
color: #FFF;
background: #ee8208;
border-right: 2px solid #FFF;
border-left: 2px solid #FFF;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
a.odnoklassniki:hover {
text-shadow: 0 36px 0 #FFF, 1px 37px 20px #FFF;
margin-top: -36px;
height: 120px;
background: #222;
}
a.facebook {
 
display: block;
line-height: 36px;
height: 36px;
width: 100%;
overflow: hidden;
text-align: center;
text-decoration: none;
font-weight: bold;
text-shadow: 0 120px 0 #FFF,1px 76px 10px #000;
color: #FFF;
background: #3b5998;
border-right: 2px solid #FFF;
border-left: 2px solid #FFF;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
a.facebook:hover {
text-shadow: 0 36px 0 #FFF, 1px 37px 20px #FFF;
margin-top: -36px;
height: 120px;
background: #222;
}
a.twitter {
 
display: block;
line-height: 36px;
height: 36px;
width: 100%;
overflow: hidden;
text-align: center;
text-decoration: none;
font-weight: bold;
text-shadow: 0 120px 0 #FFF,1px 76px 10px #000;
color: #FFF;
background: #55acee;
border-right: 2px solid #FFF;
border-left: 2px solid #FFF;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
a.twitter:hover {
text-shadow: 0 36px 0 #FFF, 1px 37px 20px #FFF;
margin-top: -36px;
height: 120px;
background: #222;
}
a.google {
 
display: block;
line-height: 36px;
height: 36px;
width: 100%;
overflow: hidden;
text-align: center;
text-decoration: none;
font-weight: bold;
text-shadow: 0 120px 0 #FFF,1px 76px 10px #000;
color: #FFF;
background: #db4437;
border-right: 2px solid #FFF;
border-left: 2px solid #FFF;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
a.google:hover {
text-shadow: 0 36px 0 #FFF, 1px 37px 20px #FFF;
margin-top: -36px;
height: 120px;
background: #222;
}
 
/* -------------------------------------------------------------------------- */

Пример кнопок


Оставьте комментарий