Sub-ratio theme beautification - bottom horizontal website information statistics module

Share the bottom horizontal website statistics module of the sudden comparison, including blog broadcasting, article statistics, browsing statistics, which is very beautiful and very practical to use!! I don't know who the original is, but the resources on the Internet are collated and tested.

Picture shown

Picture [1] - Sub-ratio theme beautification - Bottom horizontal website information statistics module - Ink dyeing cloud sky - Communication and sharing of network technology - resource station, technology station, information network

lvyelanshan

QQ1789372108header.php Add the following core function code at the bottom

<script type="text/javascript" >
//文章总数
<?php $count_posts = wp_count_posts(); $published_posts =$count_posts->publish;echo "var tj_wzzs="."'$published_posts'";?>
//本周发布
<?php $post_wpdb = get_posts_count_from_last_168h($post_type ='post');echo "var tj_bzfb="."'$post_wpdb'";?>
//运行时间
<?php $wdyx_time = floor((time()-strtotime("2024-6-25 0:0:0"))/86400);echo "var tj_yxsj="."'$wdyx_time'";?>
//用户总数
<?php global $wpdb;$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_yhzs="."'$users'";?>
//总访问量
<?php $post_view = nd_get_all_view();echo "var tj_yhzl="."'$post_view'";?>
</script>
<script type="text/javascript" >
//文章总数
<?php $count_posts = wp_count_posts(); $published_posts =$count_posts->publish;echo "var tj_wzzs="."'$published_posts'";?>
//本周发布
<?php $post_wpdb = get_posts_count_from_last_168h($post_type ='post');echo "var tj_bzfb="."'$post_wpdb'";?>
//运行时间
<?php $wdyx_time = floor((time()-strtotime("2024-6-25 0:0:0"))/86400);echo "var tj_yxsj="."'$wdyx_time'";?>
//用户总数
<?php global $wpdb;$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_yhzs="."'$users'";?>
//总访问量
<?php $post_view = nd_get_all_view();echo "var tj_yhzl="."'$post_view'";?>
</script>
<script type="text/javascript" > //文章总数 <?php $count_posts = wp_count_posts(); $published_posts =$count_posts->publish;echo "var tj_wzzs="."'$published_posts'";?> //本周发布 <?php $post_wpdb = get_posts_count_from_last_168h($post_type ='post');echo "var tj_bzfb="."'$post_wpdb'";?> //运行时间 <?php $wdyx_time = floor((time()-strtotime("2024-6-25 0:0:0"))/86400);echo "var tj_yxsj="."'$wdyx_time'";?> //用户总数 <?php global $wpdb;$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");echo "var tj_yhzs="."'$users'";?> //总访问量 <?php $post_view = nd_get_all_view();echo "var tj_yhzl="."'$post_view'";?> </script>

Path: Topic rootzibll/functions.php
Add the following code, if you have added this code, please skip this step.

/* 统计总访问量 */
function nd_get_all_view(){
global $wpdb;
$count=0;
$views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'");
foreach($views as $key=>$value){
$meta_value=$value->meta_value;
if($meta_value!=' '){
$count+=(int)$meta_value;
}
}return $count;
}
/* 统计本周文章数量 */
function get_posts_count_from_last_168h($post_type ='post') {
global $wpdb;
$numposts = $wpdb->get_var(
$wpdb->prepare(
"SELECT COUNT(ID) ".
"FROM {$wpdb->posts} ".
"WHERE ".
"post_status='publish' ".
"AND post_type= %s ".
"AND post_date> %s",
$post_type, date('Y-m-d H:i:s', strtotime('-168 hours'))
)
);
return $numposts;
}
/* 统计总访问量 */
function nd_get_all_view(){
  global $wpdb;
  $count=0;
  $views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'");
  foreach($views as $key=>$value){
    $meta_value=$value->meta_value;
    if($meta_value!=' '){
      $count+=(int)$meta_value;
    }
  }return $count;
}


/* 统计本周文章数量 */
function get_posts_count_from_last_168h($post_type ='post') {
    global $wpdb;
    $numposts = $wpdb->get_var(
        $wpdb->prepare(
            "SELECT COUNT(ID) ".
            "FROM {$wpdb->posts} ".
            "WHERE ".
                "post_status='publish' ".
                "AND post_type= %s ".
                "AND post_date> %s",
            $post_type, date('Y-m-d H:i:s', strtotime('-168 hours'))
        )
    );
    return $numposts;
}
/* 统计总访问量 */ function nd_get_all_view(){ global $wpdb; $count=0; $views= $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key='views'"); foreach($views as $key=>$value){ $meta_value=$value->meta_value; if($meta_value!=' '){ $count+=(int)$meta_value; } }return $count; } /* 统计本周文章数量 */ function get_posts_count_from_last_168h($post_type ='post') { global $wpdb; $numposts = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) ". "FROM {$wpdb->posts} ". "WHERE ". "post_status='publish' ". "AND post_type= %s ". "AND post_date> %s", $post_type, date('Y-m-d H:i:s', strtotime('-168 hours')) ) ); return $numposts; }

WordPress后台 >> 外观>> 小工具 >> Full width at the bottom of the home page自定义HTMLAdd the following code

Be sure to introduce the icon link, I am here to introduce the icon of Alibaba's icon, put it in the HTML code at the bottom of the customization, you can change it yourself, the link is as follows

<script src="//at.alicdn.com/t/c/font_4054251_lyuxfz4jkfj.js"></script>
<script src="//at.alicdn.com/t/c/font_4054251_lyuxfz4jkfj.js"></script>
<script src="//at.alicdn.com/t/c/font_4054251_lyuxfz4jkfj.js"></script>

Finally, the Zibll theme sets >> Global & Features >> Custom Code >> Custom CSS Styles

.huliku-info-item{display:grid;grid-gap:15px;grid-template-columns: repeat(6,1fr);grid-template-rows:repeat(2,1fr);width:100%;height:280px;margin-bottom:15px;}
.huliku-llzs-item, .huliku-sjcs-item, .huliku-yhzs-item, .huliku-yxsj-item{width:100%;height:100%;border-radius:8px;text-align:center;box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%);background-color:var(--main-bg-color);overflow:hidden;padding:5px;box-sizing:border-box;}
.huliku-i-num{font-size:20px;font-weight:600}
.huliku-yxsj-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-yhzs-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-llzs-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-wz-item{display:grid;grid-gap:20px;grid-template-columns:repeat(2,1fr);grid-column: 3/6;grid-row:1/2;overflow:unset!important;box-shadow:none!important;padding:0!important;}
.huliku-wz-sty{width:100%;height:100%;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-direction:column;background-color:var(--main-bg-color);box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%)}
.huliku-sjcs-item{grid-row: 1/3;grid-column: 1/3;}
.huliku-sjcj-m{position:relative;font-size:20px;font-weight:700;text-align:center;width:100%;height:100%;padding:10px;box-sizing:border-box;}
.huliku-sjcj-content{text-align:center;margin-top:10px}
.huliku-meo-item{width:282px;height:120px;margin:0 auto}
.huliku-meo-item>img{width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center center;cursor:pointer}
svg.icon.fa-2x {margin-top: 15px;}
@media screen and (max-width:959px){.huliku-info-item{grid-gap:10px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);height:500px;}
.huliku-sjcs-item{grid-row:3/5;grid-column:1/4}
.huliku-i-num{font-size:20px}
.huliku-sjcj-m{font-size:16px}}
.enlighter-default .enlighter{max-height:400px;overflow-y:auto !important;}.posts-item .item-heading>a {font-weight: bold;color: unset;}@media (max-width:640px) {.meta-right .meta-view{display: unset !important;}}
.huliku-sjcs-item2 {grid-row: 1/3;}
.huliku-sjcs-item2 {width: 100%;height: 100%;border-radius: 8px;text-align: center;box-shadow: 0 2px 4px 0 rgba(0,0%,0%,5%);background-color: var(--main-bg-color);box-sizing: border-box;grid-row: 1/3;grid-column: 6/6;}
@media screen and (max-width:959px){.huliku-wz-item{grid-column: 1/4}.huliku-sjcs-item2 {display:none}}
.huliku-ip-item, .huliku-sjcs-item, .huliku-yhzs-item, .huliku-yxsj-item{width:100%;height:100%;border-radius:8px;text-align:center;box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%);background-color:var(--main-bg-color);overflow:hidden;padding:5px;box-sizing:border-box;}
.huliku-ip-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-info-item{display:grid;grid-gap:15px;grid-template-columns: repeat(6,1fr);grid-template-rows:repeat(2,1fr);width:100%;height:280px;margin-bottom:15px;}
.huliku-llzs-item, .huliku-sjcs-item, .huliku-yhzs-item, .huliku-yxsj-item{width:100%;height:100%;border-radius:8px;text-align:center;box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%);background-color:var(--main-bg-color);overflow:hidden;padding:5px;box-sizing:border-box;}
.huliku-i-num{font-size:20px;font-weight:600}
.huliku-yxsj-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-yhzs-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-llzs-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-wz-item{display:grid;grid-gap:20px;grid-template-columns:repeat(2,1fr);grid-column: 3/6;grid-row:1/2;overflow:unset!important;box-shadow:none!important;padding:0!important;}
.huliku-wz-sty{width:100%;height:100%;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-direction:column;background-color:var(--main-bg-color);box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%)}
.huliku-sjcs-item{grid-row: 1/3;grid-column: 1/3;}
.huliku-sjcj-m{position:relative;font-size:20px;font-weight:700;text-align:center;width:100%;height:100%;padding:10px;box-sizing:border-box;}
.huliku-sjcj-content{text-align:center;margin-top:10px}
.huliku-meo-item{width:282px;height:120px;margin:0 auto}
.huliku-meo-item>img{width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center center;cursor:pointer}
svg.icon.fa-2x {margin-top: 15px;}
@media screen and (max-width:959px){.huliku-info-item{grid-gap:10px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);height:500px;}
.huliku-sjcs-item{grid-row:3/5;grid-column:1/4}
.huliku-i-num{font-size:20px}
.huliku-sjcj-m{font-size:16px}}
.enlighter-default .enlighter{max-height:400px;overflow-y:auto !important;}.posts-item .item-heading>a {font-weight: bold;color: unset;}@media (max-width:640px) {.meta-right .meta-view{display: unset !important;}}
.huliku-sjcs-item2 {grid-row: 1/3;}
.huliku-sjcs-item2 {width: 100%;height: 100%;border-radius: 8px;text-align: center;box-shadow: 0 2px 4px 0 rgba(0,0%,0%,5%);background-color: var(--main-bg-color);box-sizing: border-box;grid-row: 1/3;grid-column: 6/6;}
@media screen and (max-width:959px){.huliku-wz-item{grid-column: 1/4}.huliku-sjcs-item2 {display:none}}
.huliku-ip-item, .huliku-sjcs-item, .huliku-yhzs-item, .huliku-yxsj-item{width:100%;height:100%;border-radius:8px;text-align:center;box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%);background-color:var(--main-bg-color);overflow:hidden;padding:5px;box-sizing:border-box;}
.huliku-ip-item{display:flex;align-items:center;justify-content:center;flex-direction:column}
.huliku-info-item{display:grid;grid-gap:15px;grid-template-columns: repeat(6,1fr);grid-template-rows:repeat(2,1fr);width:100%;height:280px;margin-bottom:15px;} .huliku-llzs-item, .huliku-sjcs-item, .huliku-yhzs-item, .huliku-yxsj-item{width:100%;height:100%;border-radius:8px;text-align:center;box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%);background-color:var(--main-bg-color);overflow:hidden;padding:5px;box-sizing:border-box;} .huliku-i-num{font-size:20px;font-weight:600} .huliku-yxsj-item{display:flex;align-items:center;justify-content:center;flex-direction:column} .huliku-yhzs-item{display:flex;align-items:center;justify-content:center;flex-direction:column} .huliku-llzs-item{display:flex;align-items:center;justify-content:center;flex-direction:column} .huliku-wz-item{display:grid;grid-gap:20px;grid-template-columns:repeat(2,1fr);grid-column: 3/6;grid-row:1/2;overflow:unset!important;box-shadow:none!important;padding:0!important;} .huliku-wz-sty{width:100%;height:100%;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-direction:column;background-color:var(--main-bg-color);box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%)} .huliku-sjcs-item{grid-row: 1/3;grid-column: 1/3;} .huliku-sjcj-m{position:relative;font-size:20px;font-weight:700;text-align:center;width:100%;height:100%;padding:10px;box-sizing:border-box;} .huliku-sjcj-content{text-align:center;margin-top:10px} .huliku-meo-item{width:282px;height:120px;margin:0 auto} .huliku-meo-item>img{width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center center;cursor:pointer} svg.icon.fa-2x {margin-top: 15px;} @media screen and (max-width:959px){.huliku-info-item{grid-gap:10px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);height:500px;} .huliku-sjcs-item{grid-row:3/5;grid-column:1/4} .huliku-i-num{font-size:20px} .huliku-sjcj-m{font-size:16px}} .enlighter-default .enlighter{max-height:400px;overflow-y:auto !important;}.posts-item .item-heading>a {font-weight: bold;color: unset;}@media (max-width:640px) {.meta-right .meta-view{display: unset !important;}} .huliku-sjcs-item2 {grid-row: 1/3;} .huliku-sjcs-item2 {width: 100%;height: 100%;border-radius: 8px;text-align: center;box-shadow: 0 2px 4px 0 rgba(0,0%,0%,5%);background-color: var(--main-bg-color);box-sizing: border-box;grid-row: 1/3;grid-column: 6/6;} @media screen and (max-width:959px){.huliku-wz-item{grid-column: 1/4}.huliku-sjcs-item2 {display:none}} .huliku-ip-item, .huliku-sjcs-item, .huliku-yhzs-item, .huliku-yxsj-item{width:100%;height:100%;border-radius:8px;text-align:center;box-shadow:0 2px 4px 0 rgba(0,0%,0%,5%);background-color:var(--main-bg-color);overflow:hidden;padding:5px;box-sizing:border-box;} .huliku-ip-item{display:flex;align-items:center;justify-content:center;flex-direction:column}

The above is all the tutorials for horizontal beautification at the bottom of the sub-theme theme! !

Tips:This article was last updated in2024-07-29 20:21:36Some articles are time-sensitive, if there are errors or have expired, please be belowmessageor contactz07547262122
© Copyright Notice
THE END
If you like it, support it
LV512 Copyright © 2024 · 
5W+
Think of every day you live as the last day of your life
comments A total of 33 articles

Please log in to post a comment