{"id":71155,"date":"2012-05-28T13:27:31","date_gmt":"2012-05-28T13:27:31","guid":{"rendered":""},"modified":"2016-07-30T23:14:12","modified_gmt":"2016-07-30T23:14:12","slug":"%d0%bf%d1%80%d0%be%d0%b1%d0%bb%d0%b5%d0%bc%d0%b0-%d0%bf%d0%b0%d0%b4%d0%b6%d0%b8%d0%bd%d0%b0%d1%86%d0%b8%d0%b8-%d0%bd%d0%b0-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d0%b5-%d0%ba%d0%b0%d1%82%d0%b5","status":"closed","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d0%bf%d1%80%d0%be%d0%b1%d0%bb%d0%b5%d0%bc%d0%b0-%d0%bf%d0%b0%d0%b4%d0%b6%d0%b8%d0%bd%d0%b0%d1%86%d0%b8%d0%b8-%d0%bd%d0%b0-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d0%b5-%d0%ba%d0%b0%d1%82%d0%b5\/","title":{"rendered":"\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0430\u0434\u0436\u0438\u043d\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439"},"content":{"rendered":"<p>\u0423 \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430: \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u0435\u043b\u0430\u044e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u0442\u0438\u043f\u0430\u043c. \u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Custom \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0411\u0414.<\/p>\n<pre><code>$total = &quot;\n\t    SELECT $wpdb-&gt;posts.*\n\t    FROM $wpdb-&gt;posts\n\t    LEFT JOIN $wpdb-&gt;postmeta ON ($wpdb-&gt;posts.ID = $wpdb-&gt;postmeta.post_id)\n\t    LEFT JOIN $wpdb-&gt;term_relationships ON ($wpdb-&gt;posts.ID=$wpdb-&gt;term_relationships.object_id)\n\t    WHERE $wpdb-&gt;postmeta.meta_key = &#039;price&#039;\n\t    AND $wpdb-&gt;posts.post_status = &#039;publish&#039;\n\t    AND $wpdb-&gt;posts.post_type = &#039;post&#039;\n\t    AND $wpdb-&gt;term_relationships.term_taxonomy_id = &#039;5&#039;\n\t    ORDER BY $wpdb-&gt;postmeta.meta_value DESC\n\t    &quot;;\n\t$totalposts = $wpdb-&gt;get_results($total, OBJECT);\n\t$ppp = intval(&#039;12&#039;);\n\t$wp_query-&gt;found_posts = count($totalposts);\n\t$wp_query-&gt;max_num_pages = ceil($wp_query-&gt;found_posts \/ $ppp);\n\t$on_page = intval(get_query_var(&#039;paged&#039;));\n\tif($on_page == 0){ $on_page = 1; }\n\t$offset = ($on_page-1) * $ppp;\n\techo $offset;\n\t$wp_query-&gt;request = &quot;\n\t    SELECT $wpdb-&gt;posts.*\n\t    FROM $wpdb-&gt;posts\n\t    LEFT JOIN $wpdb-&gt;postmeta ON ($wpdb-&gt;posts.ID = $wpdb-&gt;postmeta.post_id)\n\t    LEFT JOIN $wpdb-&gt;term_relationships ON ($wpdb-&gt;posts.ID=$wpdb-&gt;term_relationships.object_id)\n\t    WHERE $wpdb-&gt;postmeta.meta_key = &#039;price&#039;\n\t    AND $wpdb-&gt;posts.post_status = &#039;publish&#039;\n\t    AND $wpdb-&gt;posts.post_type = &#039;post&#039;\n\t    AND $wpdb-&gt;term_relationships.term_taxonomy_id = &#039;5&#039;\n\t    ORDER BY $wpdb-&gt;postmeta.meta_value DESC\n\t    LIMIT $ppp OFFSET $offset&quot;;\n\t$pageposts = $wpdb-&gt;get_results($wp_query-&gt;request, OBJECT);?&gt;<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 122\u0439 &#8212; \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 122 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u043d \u0432\u044b\u0434\u0430\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 404. \u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438 \u043a\u0430\u043a \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f?<\/p>\n","protected":false},"template":"","class_list":["post-71155","topic","type-topic","status-closed","hentry","topic-tag-564","topic-tag-archive","topic-tag-130"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/71155","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\/71155\/revisions"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=71155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}