{"id":189878,"date":"2015-10-28T19:58:07","date_gmt":"2015-10-28T19:58:07","guid":{"rendered":"https:\/\/ru.wordpress.org\/support\/2015\/10\/28\/%d0%94%d0%be%d1%87%d0%b5%d1%80%d0%bd%d0%b8%d0%b5-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b-%d1%87%d0%b5%d1%80%d0%b5%d0%b7-%d1%88%d0%be%d1%80%d1%82%d0%ba%d0%be%d0%b4\/"},"modified":"2015-10-28T19:58:07","modified_gmt":"2015-10-28T19:58:07","slug":"%d0%94%d0%be%d1%87%d0%b5%d1%80%d0%bd%d0%b8%d0%b5-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b-%d1%87%d0%b5%d1%80%d0%b5%d0%b7-%d1%88%d0%be%d1%80%d1%82%d0%ba%d0%be%d0%b4","status":"publish","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d0%94%d0%be%d1%87%d0%b5%d1%80%d0%bd%d0%b8%d0%b5-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b-%d1%87%d0%b5%d1%80%d0%b5%d0%b7-%d1%88%d0%be%d1%80%d1%82%d0%ba%d0%be%d0%b4\/","title":{"rendered":"\u0414\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0447\u0435\u0440\u0435\u0437 \u0448\u043e\u0440\u0442\u043a\u043e\u0434"},"content":{"rendered":"<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0432\u0435\u0447\u0435\u0440.<br \/>\n\u0415\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e \u0432 page.php<\/p>\n<pre><code>function asd() {\n$childpages = new WP_Query( array(\n\t&#039;post_type&#039;      =&gt; &#039;page&#039;,\n\t&#039;post_parent&#039;    =&gt; $this_page,\n\t&#039;posts_per_page&#039; =&gt; 100,\n\t&#039;orderby&#039;        =&gt; &#039;menu_order&#039;,\n\t&#039;post__in&#039; =&gt; array( 11 )\n));\n\twhile ( $childpages-&gt;have_posts() ) : $childpages-&gt;the_post(); ?&gt;\n\n\t&lt;section&gt;\n\n\t\t&lt;a href=&quot;&lt;?php echo get_page_link( $page-&gt;ID );?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;\n\t\t\t&lt;div class=&quot;content&quot;&gt;\n\n\t\t\t\t&lt;?php $this_subpage=$post-&gt;ID; ?&gt;\n\n\t\t\t\t&lt;?php\n\t\t\t\t\/\/Loop through the sub-pages of the child pages next\n\t\t\t\t$subpages = new WP_Query( array(\n\t\t\t\t\t&#039;post_type&#039; =&gt; &#039;page&#039;,\n\t\t\t\t\t&#039;post_parent&#039; =&gt; $this_subpage,\n\t\t\t\t\t&#039;posts_per_page&#039; =&gt; 0,\n\t\t\t\t\t&#039;orderby&#039; =&gt; &#039;menu_order&#039;,\n\t\t\t\t\t&#039;post_parent__in&#039; =&gt; array(11)\n\t\t\t\t));\n\t\t\t\twhile ( $subpages-&gt;have_posts() ) : $subpages-&gt;the_post(); ?&gt;\n\t\t\t\t\t&lt;section class=&quot;subpages&quot;&gt;\n\n\t\t\t\t\t\t&lt;a href=&quot;&lt;?php echo get_page_link( $page-&gt;ID );?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;\n\t\t\t\t\t\t&lt;div&gt;\n\n\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;\/section&gt;\n\t\t\t\t&lt;?php endwhile; wp_reset_query(); ?&gt;\n\n\t\t&lt;\/div&gt;&lt;!--.content --&gt;\n\t&lt;\/section&gt;\n&lt;?php endwhile; wp_reset_query(); }\n asd();?&gt;<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0435\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 &#8212; \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0415 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0447\u0435\u0440\u0435\u0437 \u0448\u043e\u0440\u0442\u043a\u043e\u0434 (\u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0432 \u044d\u0442\u043e\u043c) \u0434\u0435\u043b\u0430\u044e \u0442\u0430\u043a:<\/p>\n<pre><code>function wp_p() {\n\n$childpages = new WP_Query( array(\n\t&#039;post_type&#039;      =&gt; &#039;page&#039;,\n\t&#039;post_parent&#039;    =&gt; $this_page,\n\t&#039;posts_per_page&#039; =&gt; 100,\n\t&#039;orderby&#039;        =&gt; &#039;menu_order&#039;,\n\t&#039;post__in&#039; =&gt; array( 11 )\n));\n\twhile ( $childpages-&gt;have_posts() ) : $childpages-&gt;the_post(); \n\n\t$string1 =  &#039;&lt;ul class=&quot;side-menu&quot;&gt;&lt;li&gt;&lt;a href=&quot;&#039;.get_page_link( $post-&gt;ID ).&#039;&quot;&gt;&#039;.get_the_title().&#039;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n\n\t\t\t\t $this_subpage=$post-&gt;ID; \n\n\t\t\t\t\/\/Loop through the sub-pages of the child pages next\n\t\t\t\t$subpages = new WP_Query( array(\n\t\t\t\t\t&#039;post_type&#039; =&gt; &#039;page&#039;,\n\t\t\t\t\t&#039;post_parent&#039; =&gt; $this_subpage,\n\t\t\t\t\t&#039;posts_per_page&#039; =&gt; -1,\n\t\t\t\t\t&#039;order&#039; =&gt; &#039;ASC&#039;,\n\t\t\t\t\t&#039;orderby&#039; =&gt; &#039;date&#039;,\n\t\t\t\t\t&#039;post_parent__in&#039; =&gt; array(11)\n\t\t\t\t));\n\t\t\t\twhile ( $subpages-&gt;have_posts() ) : $subpages-&gt;the_post();\n\n\t\t\t\t\t$string2 =  &#039;&lt;li&gt;&lt;a href=&quot;&#039;.get_page_link( $post-&gt;ID ).&#039;&quot;&gt;&#039;.get_the_title().&#039;&lt;\/a&gt;&lt;\/li&gt;&lt;\/ul&gt;&#039;;\n\t\t\t\t\t\treturn $string1.$string2;\n\n\t\t\t\tendwhile; wp_reset_query();\n\n endwhile; wp_reset_query(); \n\n}\nadd_shortcode(&#039;lch&#039;, &#039;wp_p&#039;);<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043e\u0434\u043d\u0443 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e, \u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e (\u043d\u0443 \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 &#8216;order&#8217; =&gt; &#8216;ASC&#8217;,<br \/>\n\t\t\t\t\t&#8216;orderby&#8217; =&gt; &#8216;date&#8217;,) \u043f\u0435\u0440\u0432\u0443\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e<\/p>\n<p>\u041f\u043e\u0434\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a?<\/p>\n","protected":false},"template":"","class_list":["post-189878","topic","type-topic","status-publish","hentry","topic-tag-4775"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/189878","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\/189878\/revisions"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=189878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}