{"id":289074,"date":"2018-06-25T11:59:21","date_gmt":"2018-06-25T08:59:21","guid":{"rendered":"https:\/\/ru.wordpress.org\/support\/topic\/%d0%ba%d0%b0%d0%ba-%d0%b2%d1%8b%d0%b2%d0%b5%d1%81%d1%82%d0%b8-%d0%bf%d1%80%d0%be%d0%b8%d0%b7%d0%b2%d0%be%d0%bb%d1%8c%d0%bd%d1%8b%d0%b5-%d1%82%d0%b8%d0%bf%d1%8b-%d0%b7%d0%b0%d0%bf%d0%b8%d1%81%d0%b5-2\/"},"modified":"2018-06-25T11:59:21","modified_gmt":"2018-06-25T08:59:21","slug":"%d0%ba%d0%b0%d0%ba-%d0%b2%d1%8b%d0%b2%d0%b5%d1%81%d1%82%d0%b8-%d0%bf%d1%80%d0%be%d0%b8%d0%b7%d0%b2%d0%be%d0%bb%d1%8c%d0%bd%d1%8b%d0%b5-%d1%82%d0%b8%d0%bf%d1%8b-%d0%b7%d0%b0%d0%bf%d0%b8%d1%81%d0%b5-2","status":"publish","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d0%ba%d0%b0%d0%ba-%d0%b2%d1%8b%d0%b2%d0%b5%d1%81%d1%82%d0%b8-%d0%bf%d1%80%d0%be%d0%b8%d0%b7%d0%b2%d0%be%d0%bb%d1%8c%d0%bd%d1%8b%d0%b5-%d1%82%d0%b8%d0%bf%d1%8b-%d0%b7%d0%b0%d0%bf%d0%b8%d1%81%d0%b5-2\/","title":{"rendered":"\u041a\u0430\u043a \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c?"},"content":{"rendered":"<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442.<\/p>\n<p>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u043d\u0438\u0445.<br \/>\n\u041d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c. \u0415\u0441\u0442\u044c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 10 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u0441\u0442\u044b \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c.<\/p>\n<p>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 1 &#8212; \u043f\u043e\u0441\u0442 \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u2116 1<br \/>\n\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2 &#8212; \u043f\u043e\u0441\u0442 \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u2116 2<\/p>\n<p>.. \u0438 \u0442.\u043f<\/p>\n<p>\u041a\u043e\u0434 function.php<\/p>\n<pre><code>register_post_type(&#039;services&#039;, array(\n    &#039;label&#039;  =&gt; null,\n    &#039;labels&#039; =&gt; array(\n      &#039;name&#039;               =&gt; &#039;\u0423\u0441\u043b\u0443\u0433\u0438&#039;, \n      &#039;singular_name&#039;      =&gt; &#039;____&#039;, \n      &#039;add_new&#039;            =&gt; &#039;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#039;, \n      &#039;add_new_item&#039;       =&gt; &#039;\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435&#039;, \n      &#039;edit_item&#039;          =&gt; &#039;\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#039;, \n      &#039;new_item&#039;           =&gt; &#039;\u041d\u043e\u0432\u043e\u0435&#039;, \n      &#039;view_item&#039;          =&gt; &#039;\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c&#039;, \n      &#039;search_items&#039;       =&gt; &#039;\u0418\u0441\u043a\u0430\u0442\u044c&#039;, \n      &#039;not_found&#039;          =&gt; &#039;\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e&#039;, \n      &#039;not_found_in_trash&#039; =&gt; &#039;\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435&#039;, \n      &#039;menu_name&#039;          =&gt; &#039;\u0423\u0441\u043b\u0443\u0433\u0438&#039;, \n    ),\n    &#039;public&#039;              =&gt; true,\n    &#039;show_ui&#039;             =&gt; true, \n    &#039;menu_icon&#039;           =&gt; &#039;dashicons-controls-play&#039;, \n    &#039;taxonomies&#039;          =&gt; array(&#039;category&#039;),\n    &#039;supports&#039;            =&gt; array(&#039;title&#039;,&#039;editor&#039;, &#039;thumbnail&#039;, &#039;excerpt&#039;, &#039;permalink&#039;),\n  ) );\n});\n\nfunction getServices() {\n  $args = array(\n    &#039;numberposts&#039; =&gt; 4,\n    &#039;category&#039; =&gt; 0,\n    &#039;orderby&#039; =&gt; &#039;date&#039;,\n    &#039;order&#039; =&gt; &#039;DESC&#039;,\n    &#039;include&#039; =&gt; array(),\n    &#039;exclude&#039; =&gt; array(),\n    &#039;meta_key&#039; =&gt; &#039;&#039;,\n    &#039;meta_value&#039; =&gt; &#039;&#039;,\n    &#039;post_type&#039; =&gt; &#039;services&#039;,\n    &#039;suppress_filters&#039; =&gt; true,\n    );\n\n  return get_posts($args);\n}<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0446\u0438\u043a\u043b\u0430:<\/p>\n<pre><code>&lt;?php foreach(getServices() as $post): ?&gt;\n&lt;div class=&quot;content-page__block&quot;&gt;\n  &lt;div class=&quot;content-page__image&quot;&gt;\n    &lt;?php echo get_the_post_thumbnail( $page-&gt;ID, &#039;thumbnail&#039;, array(&#039;class&#039; =&gt; &#039;content-page__img&#039;)); ?&gt;\n  &lt;\/div&gt;\n  &lt;div class=&quot;content-page__wrap&quot;&gt;\n    &lt;h3 class=&quot;content-page__title&quot;&gt;&lt;?php echo $post-&gt;post_title; ?&gt;&lt;\/h3&gt;\n    &lt;p class=&quot;content-page__text&quot;&gt;\n      &lt;?php echo $post-&gt;post_content; ?&gt;\n    &lt;\/p&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;?php endforeach; ?&gt;\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-289074","topic","type-topic","status-publish","hentry","topic-tag-8466","topic-tag-post_type","topic-tag-wordpress"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/289074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/289074\/revisions"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=289074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}