{"id":220030,"date":"2023-01-28T18:12:00","date_gmt":"2023-01-28T15:12:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=220030"},"modified":"2023-01-28T18:16:26","modified_gmt":"2023-01-28T15:16:26","slug":"kak-pokazat-soobshhenija-istoricheskogo-segodnja-v-wordpress","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/ru\/kak-pokazat-soobshhenija-istoricheskogo-segodnja-v-wordpress\/","title":{"rendered":"\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u00ab\u0421\u0435\u0433\u043e\u0434\u043d\u044f\u00bb \u0432 WordPress?"},"content":{"rendered":"<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u00ab\u041f\u043e\u0445\u043e\u0436\u0438\u0435\u00bb \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0435\u0433\u0438, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430), \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u00ab\u0421\u0435\u0433\u043e\u0434\u043d\u044f\u00bb \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 PHP \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 functions.php \u0448\u0430\u0431\u043b\u043e\u043d\u0430 <strong>\u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/strong> wordpress, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/wordpress.mediadoma.com\/ru\/detskaja-tema-wordpress-vse-chto-vam-nuzhno-znat\/\" title=\"\u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u0442\u0435\u043c\u0443\">\u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u0442\u0435\u043c\u0443<\/a>.<\/p>\n<pre><code>function today_in_histroy(){\n\u00a0 \u00a0 $today = getdate();\n\u00a0 \u00a0 $args = array(\n\u00a0 \u00a0 \u00a0 \u00a0 'date_query' =&gt; array(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 array(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 'year' \u00a0 \u00a0 \u00a0=&gt; $today['year'],\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 'compare' \u00a0 =&gt; '!=',\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 array(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 'month' =&gt; $today['mon'],\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 'day' \u00a0 =&gt; $today['mday'],\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ),\n\u00a0 \u00a0 \u00a0 \u00a0 ),\n\u00a0 \u00a0 );\n\u00a0 \u00a0 $postlist = get_posts($args);\n\u00a0 \u00a0 $html = '&lt;h3 class=\"tih-title\"&gt;Posts of Historic Today&lt;\/h3&gt;&lt;ul class=\"tih-title-list\"&gt;';\n\u00a0 \u00a0 if(!empty($postlist)){\n\u00a0 \u00a0 \u00a0 \u00a0 foreach ($postlist as $key =&gt; $post) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $html .= '&lt;li class=\"tih-title-item\"&gt;&lt;a href=\"'. get_permalink($post-&gt;ID). '\" title=\"'. $post-&gt;post_title. '\"&gt;'. $post-&gt;post_title. '&lt;\/a&gt;&lt;\/li&gt;';\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 $html .= '&lt;\/ul&gt;';\n\u00a0 \u00a0 \u00a0 \u00a0 return $html;\n\u00a0 \u00a0 }\n\u00a0 \u00a0 return \"\";\n}\n\u00a0\nfunction add_today_in_histroy($content){\n\u00a0 \u00a0 global $post;\n\u00a0 \u00a0 return \u00a0$content. today_in_histroy(); \n}\nadd_filter('the_content','add_today_in_histroy');<\/code><\/pre>\n<p>\u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0449\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <strong>add_filter<\/strong> \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 <strong>the_content<\/strong>.<\/p>\n<p>\u0432\u043e\u0440\u0434\u043f\u0440\u0435\u0441\u0441<\/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 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u00ab\u0421\u0435\u0433\u043e\u0434\u043d\u044f\u00bb \u0432 WordPress?<\/p>\n","protected":false},"author":1,"featured_media":221210,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[809,870,900,990,921,618,850],"tags":[1171],"class_list":["post-220030","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-ru","category-wordpress-ru","category-kod-2","category-kontent-marketing","category-drugoj","category-rukovodstvo-dlja-nachinajushhih","category-uchebniki-ru","tag-affiai-ru"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts\/220030","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=220030"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts\/220030\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/media\/221210"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/media?parent=220030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/categories?post=220030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/tags?post=220030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}