<?php // Get total number of posts in post-type-name
$count_posts = wp_count_posts('post-type-name');
$total_posts = $count_posts->publish;
echo $total_posts . ' custom posts. ';
?>
Thứ Tư, 24 tháng 1, 2018
Hiển thị tổng số bài post theo post type wordpress
Thứ Năm, 16 tháng 11, 2017
Button icon contact left website
https://codepen.io/zota-kenit/pen/LOjgOM
Thứ Ba, 24 tháng 10, 2017
Thứ Tư, 18 tháng 10, 2017
Ẩn thông báo Update theme, source plugin cho Website
/**
* Ẩn thông báo Update Website
*/
function ebsviet_remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','ebsviet_remove_core_updates'); //hide updates for WordPress itself
add_filter('pre_site_transient_update_plugins','ebsviet_remove_core_updates'); //hide updates for all plugins
add_filter('pre_site_transient_update_themes','ebsviet_remove_core_updates'); //hide updates for all themes
* Ẩn thông báo Update Website
*/
function ebsviet_remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','ebsviet_remove_core_updates'); //hide updates for WordPress itself
add_filter('pre_site_transient_update_plugins','ebsviet_remove_core_updates'); //hide updates for all plugins
add_filter('pre_site_transient_update_themes','ebsviet_remove_core_updates'); //hide updates for all themes
Thứ Hai, 2 tháng 10, 2017
Button nút gọi Ring CSS
<div class='phone'>
<a href="#">
<div class="quick-alo-ph-circle"></div>
<div class="quick-alo-ph-circle-fill"></div>
<div class="quick-alo-ph-img-circle"></div>
</a>
</div>
<a href="#">
<div class="quick-alo-ph-circle"></div>
<div class="quick-alo-ph-circle-fill"></div>
<div class="quick-alo-ph-img-circle"></div>
</a>
</div>
.phone {
position: fixed;
bottom: 250px;
left: 0px;
position: fixed;
bottom: 250px;
left: 0px;
}
.quick-alo-phone .quick-alo-show {
visibility: visible;
}
.quick-alo-phone {
position: fixed;
visibility: hidden;
background-color: transparent;
height: 200px;
width: 82px;
height: 64px;
right: 150px;
top: 60%;
cursor: pointer;
z-index: 200000 !important;
-webkit-backface-visibility: hidden;
-webkit-transform: translateZ(0);
transition: visibility .5s;
}
.quick-alo-phone .quick-alo-green .quick-alo-ph-circle {
border-color: #00A1FF;
opacity: 0.5;
}
.quick-alo-ph-circle {
position: absolute;
width: 160px;
height: 160px;
top: 50px;
left: 50px;
border: 2px solid #00A1FF;
background-color: transparent;
border-radius: 100%;
opacity: .1;
animation: quick-alo-circle-anim 1.2s infinite ease-in-out;
transition: all .5s;
transform-origin: 50% 50%;
}
.quick-alo-phone .quick-alo-green .quick-alo-ph-circle-fill {
background-color: rgb(246, 202, 98);
opacity: .75 !important;
}
.quick-alo-ph-circle-fill {
position: absolute;
width: 100px;
height: 100px;
top: 80px;
left: 80px;
background-color: rgba(0, 161, 255, 0.5);
border-radius: 100%;
border: 2px solid transparent;
opacity: .1;
animation: quick-alo-circle-fill-anim 2.3s infinite ease-in-out;
transition: all .5s;
transform-origin: 50% 50%;
}
.quick-alo-phone.quick-alo-green .quick-alo-ph-img-circle {
background-color: #00A1FF;
}
.quick-alo-ph-img-circle {
position: absolute;
width: 60px;
height: 60px;
top: 100px;
left: 100px;
background: #00A1FF url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABrklEQVRYR82XjTEEQRCFX0dABlwEiAARkAEyIAJEoERACETARUAIJwIyeOqptfbm5qeP3lpTdVVXVzPd3/R0v+4zTLxsYv/4XwAkrwDsV6JyZmaLyKj1ESB5AOCpYfzazAQZttYFuDWz8zDvwE8OkNwF8NIwvjCz2SgAMkqSDuOzyDxYqgKSrwB2GhBKxHsHqGtLCiDDJ42Tj2Z27LLu2JQCnAK4a5x7M7Nth23XlhRgE8B74+SemempQtaKEpKsPUPo++sGOYCSIIU7zwJ05ficSLLkV6H/CIn7wEi2GRVkOVwFixEoREE/hz9DsR2TVKkp2zeSsI9bBUNnJNV4bhIA5cFhVCk2B5JCWVYhSEopjwAob6qa4QGQOKkqcj1iJSdIpmoqWEHIhr7Ph1BNgC4haxAPAC7UITPOc1UrCOXR12TlAnBAyKhAdHvPUg4pIn6AAYQc1ebG8QC+LXfD66XHU2HP7yKQlKhGODWu1gCTY/g7wCAaendNyltrRCQOIAERjCc/ejV1V4H3dp2ES4jU1vVJpXxpogoHSEE7oOEIp9G+/3c1OkArcpMDfAIqL6EhVS6JOAAAAABJRU5ErkJggg==") no-repeat center center;
border-radius: 100%;
border: 2px solid transparent;
opacity: .99;
animation: quick-alo-circle-img-anim 1s infinite ease-in-out;
transform-origin: 50% 50%;
}
.quick-alo-phone .quick-alo-green .quick-alo-hover .quick-alo-ph-img-circle,
.quick-alo-phone.quick-alo-green:hover .quick-alo-ph-img-circle {
background-color: #ff0101;
}
@-moz-keyframes quick-alo-circle-anim {
0% {
-moz-transform: rotate(0) scale(.5) skew(1deg);
opacity: .1;
-moz-opacity: .1;
-webkit-opacity: .1;
-o-opacity: .1
}
30% {
-moz-transform: rotate(0) scale(.7) skew(1deg);
opacity: .5;
-moz-opacity: .5;
-webkit-opacity: .5;
-o-opacity: .5
}
100% {
-moz-transform: rotate(0) scale(1) skew(1deg);
opacity: .6;
-moz-opacity: .6;
-webkit-opacity: .6;
-o-opacity: .1
}
}
@-webkit-keyframes quick-alo-circle-anim {
0% {
-webkit-transform: rotate(0) scale(.5) skew(1deg);
-webkit-opacity: .1
}
30% {
-webkit-transform: rotate(0) scale(.7) skew(1deg);
-webkit-opacity: .5
}
100% {
-webkit-transform: rotate(0) scale(1) skew(1deg);
-webkit-opacity: .1
}
}
@-o-keyframes quick-alo-circle-anim {
0% {
-o-transform: rotate(0) kscale(.5) skew(1deg);
-o-opacity: .1
}
30% {
-o-transform: rotate(0) scale(.7) skew(1deg);
-o-opacity: .5
}
100% {
-o-transform: rotate(0) scale(1) skew(1deg);
-o-opacity: .1
}
}
@-moz-keyframes quick-alo-circle-fill-anim {
0% {
-moz-transform: rotate(0) scale(.7) skew(1deg);
opacity: .2
}
50% {
-moz-transform: rotate(0) -moz-scale(1) skew(1deg);
opacity: .2
}
100% {
-moz-transform: rotate(0) scale(.7) skew(1deg);
opacity: .2
}
}
@-webkit-keyframes quick-alo-circle-fill-anim {
0% {
-webkit-transform: rotate(0) scale(.7) skew(1deg);
opacity: .2
}
50% {
-webkit-transform: rotate(0) scale(1) skew(1deg);
opacity: .2
}
100% {
-webkit-transform: rotate(0) scale(.7) skew(1deg);
opacity: .2
}
}
@-o-keyframes quick-alo-circle-fill-anim {
0% {
-o-transform: rotate(0) scale(.7) skew(1deg);
opacity: .2
}
50% {
-o-transform: rotate(0) scale(1) skew(1deg);
opacity: .2
}
100% {
-o-transform: rotate(0) scale(.7) skew(1deg);
opacity: .2
}
}
@-moz-keyframes quick-alo-circle-img-anim {
0% {
transform: rotate(0) scale(1) skew(1deg)
}
10% {
-moz-transform: rotate(-25deg) scale(1) skew(1deg)
}
20% {
-moz-transform: rotate(25deg) scale(1) skew(1deg)
}
30% {
-moz-transform: rotate(-25deg) scale(1) skew(1deg)
}
40% {
-moz-transform: rotate(25deg) scale(1) skew(1deg)
}
50% {
-moz-transform: rotate(0) scale(1) skew(1deg)
}
100% {
-moz-transform: rotate(0) scale(1) skew(1deg)
}
}
@-webkit-keyframes quick-alo-circle-img-anim {
0% {
-webkit-transform: rotate(0) scale(1) skew(1deg)
}
10% {
-webkit-transform: rotate(-25deg) scale(1) skew(1deg)
}
20% {
-webkit-transform: rotate(25deg) scale(1) skew(1deg)
}
30% {
-webkit-transform: rotate(-25deg) scale(1) skew(1deg)
}
40% {
-webkit-transform: rotate(25deg) scale(1) skew(1deg)
}
50% {
-webkit-transform: rotate(0) scale(1) skew(1deg)
}
100% {
-webkit-transform: rotate(0) scale(1) skew(1deg)
}
}
@-o-keyframes quick-alo-circle-img-anim {
0% {
-o-transform: rotate(0) scale(1) skew(1deg)
}
10% {
-o-transform: rotate(-25deg) scale(1) skew(1deg)
}
20% {
-o-transform: rotate(25deg) scale(1) skew(1deg)
}
30% {
-o-transform: rotate(-25deg) scale(1) skew(1deg)
}
40% {
-o-transform: rotate(25deg) scale(1) skew(1deg)
}
50% {
-o-transform: rotate(0) scale(1) skew(1deg)
}
100% {
-o-transform: rotate(0) scale(1) skew(1deg)
}
}
@-moz-keyframes fadeInRight {
0% {
opacity: 0;
-webkit-transform: translate3d(100%, 0, 0);
-ms-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0)
}
100% {
opacity: 1;
-webkit-transform: none;
-ms-transform: none;
transform: none
}
}
@-webkit-keyframes fadeInRight {
0% {
opacity: 0;
-webkit-transform: translate3d(100%, 0, 0);
-ms-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0)
}
100% {
opacity: 1;
-webkit-transform: none;
-ms-transform: none;
transform: none
}
}
@-o-keyframes fadeInRight {
0% {
opacity: 0;
-webkit-transform: translate3d(100%, 0, 0);
-ms-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0)
}
100% {
opacity: 1;
-webkit-transform: none;
-ms-transform: none;
transform: none
}
}
Thứ Năm, 7 tháng 9, 2017
Cách hủy lời mời kết bạn facebook đã gửi hàng loạt
javascript:var x=document.getElementsByClassName("_55sr");for(var i=0;i<x.length;i++){if (x[i].innerHTML=='Hoàn tác'){x[i].click();}};
Bên trên là đoạn code F12 giúp bạn hủy hàng loạt yêu cầu kết bạn của bạn đã gửi cho người khác.
Thứ Ba, 29 tháng 8, 2017
Giới hạn ký tự trong WP cực đơn giản với hàm của WP
wp_trim_words
1 hàm của WP 3.3 trở lên
Với hàm này bạn có thể giới hạn ký tự của 1 dòng chữ 1 cách đơn giản
Ví dụ:
1 hàm của WP 3.3 trở lên
Với hàm này bạn có thể giới hạn ký tự của 1 dòng chữ 1 cách đơn giản
Ví dụ:
echo wp_trim_words( get_the_content(), 120 ); // Dành cho content
echo wp_trim_words( get_the_excerpt(), 60 ); // Dành cho excerpt
echo wp_trim_words( get_the_title(), 40 ); // Dành cho title
Đăng ký:
Bài đăng (Atom)