{"id":220077,"date":"2023-02-01T16:56:00","date_gmt":"2023-02-01T13:56:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=220077"},"modified":"2022-08-10T00:45:12","modified_gmt":"2022-08-09T21:45:12","slug":"kak-otobrazhat-statistiku-bloga-v-nizhnem-kolontitule-stranicy","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/ru\/kak-otobrazhat-statistiku-bloga-v-nizhnem-kolontitule-stranicy\/","title":{"rendered":"\u041a\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0431\u043b\u043e\u0433\u0430 \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u0442\u0438\u0442\u0443\u043b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b?"},"content":{"rendered":"<p>\u041f\u043e\u0447\u0442\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0435\u043c\u0435 WordPress \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b <strong>footer.php<\/strong>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043c\u0430\u043a\u0435\u0442 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u043a\u043e\u043b\u043e\u043d\u0442\u0438\u0442\u0443\u043b\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 PHP+MySQL \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0431\u043b\u043e\u0433\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<pre><code>&lt;?php\nglobal $wpdb;\/\/ &lt;a class=\"vglnk\" target=\"_blank\" href=\"https:\/\/helloacm.com\" rel=\"nofollow\"&gt;&lt;span&gt;https&lt;\/span&gt;&lt;span&gt;:\/\/&lt;\/span&gt;&lt;span&gt;helloacm&lt;\/span&gt;&lt;span&gt;.&lt;\/span&gt;&lt;span&gt;com&lt;\/span&gt;&lt;\/a&gt;\n$query = \"select count(1) from `wp_posts` where `post_status`='publish' and `post_type`='post'\";\n$cnt_posts = $wpdb-&gt;get_var($query);\n$query = \"select count(1) from `wp_posts` where `post_status`='publish' and `post_type`='page'\";\n$cnt_pages = $wpdb-&gt;get_var($query);\n$query = \"select count(1) from `wp_comments` where `comment_approved`=1\";\n$cnt_comments = $wpdb-&gt;get_var($query);\n$start = strtotime(\"2011-07-03 00:00:00\"); \u00a0\/\/ Need to replace the date to the date when you published your first article.\n$today = strtotime(date(\"Y-m-d h:i:s\"));\n$days = round(abs($today - $start) \/ 3600 \/ 24);\n?&gt;\n\u00a0\nBlog is up for &lt;?php echo $days;?&gt; days, and there are &lt;?php echo $cnt_posts;?&gt; posts and &lt;?php echo $cnt_pages;?&gt; pages, there are &lt;?php echo $cnt_comments;?&gt; comments.<\/code><\/pre>\n<p>\u0414\u0430\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442, \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 PHP <strong>$start<\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 PHP \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 SQL \u0434\u043b\u044f \u0442\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0434\u043d\u044f\u0445.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u043a\u0435\u0448\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430 WordPress, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0430\u0448 \u043a\u0435\u0448 \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/helloacm.com\" class=\"external external_icon\">helloacm.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0431\u043b\u043e\u0433\u0430 \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u0442\u0438\u0442\u0443\u043b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b?<\/p>\n","protected":false},"author":1,"featured_media":223984,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[809,870,900,820,850],"tags":[1171],"class_list":["post-220077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-ru","category-wordpress-ru","category-kod-2","category-plaginy-ru","category-uchebniki-ru","tag-affiai-ru"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts\/220077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/comments?post=220077"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts\/220077\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/media\/223984"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/media?parent=220077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/categories?post=220077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/tags?post=220077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}