{"id":54188,"date":"2015-09-09T20:23:33","date_gmt":"2015-09-09T20:23:33","guid":{"rendered":"https:\/\/br.wordpress.org\/support\/topic\/duvida-de-loop-com-paginacao\/"},"modified":"2016-08-06T01:41:09","modified_gmt":"2016-08-06T01:41:09","slug":"duvida-de-loop-com-paginacao","status":"publish","type":"topic","link":"https:\/\/br.wordpress.org\/support\/topic\/duvida-de-loop-com-paginacao\/","title":{"rendered":"D\u00favida de loop com pagina\u00e7\u00e3o"},"content":{"rendered":"<p>Galera, tenho o seguinte c\u00f3digo, e gostaria de saber como fa\u00e7o para inserir uma pagina\u00e7\u00e3o neste loop, por exemplo, toda vez que aparecer o box5 ele insira uma pagina\u00e7\u00e3o <\/p>\n<p> $q = new WP_Query(<br \/>\n        array(&#8216;posts_per_page&#8217; =&gt; -1, &#8216;post_type&#8217; =&gt; &#8216;rd-hover&#8217;, &#8216;hover_cat&#8217; =&gt; $category)<br \/>\n        );<\/p>\n<p>\t\twhile($q-&gt;have_posts()) : $q-&gt;the_post();<br \/>\n\t\t$id = get_the_ID();\t<\/p>\n<p>\t\t$rdmeta = vp_metabox(&#8216;rdmeta.rd-hover&#8217;, false);<\/p>\n<p>\t$i = 0;<br \/>\n\t$x = 1;<\/p>\n<p>\t\t$output = &#8216;&lt;div id=&#8221;&#8216;.$style.'&#8221;&gt;<\/p>\n<ul>&#8216;;<\/p>\n<p>\t\tforeach ($rdmeta as $info) {\t<\/p>\n<p>\t\tif ($effects==&#8221;square&#8221;) {<br \/>\n\t\t\tif ($x == 1)<br \/>\n\t\t\t\t$box = &#8216;box1&#8217;;<br \/>\n\t\t\tif ($x == 2)<br \/>\n\t\t\t\t$box = &#8216;box2&#8217;;<br \/>\n\t\t\tif ($x == 3)<br \/>\n\t\t\t\t$box = &#8216;box3&#8217;;<br \/>\n\t\t\tif ($x == 4)<br \/>\n\t\t\t\t$box = &#8216;box4&#8217;;<br \/>\n\t\t\t$output .= &#8216;<br \/>\n\t\t\t&lt;style type=&#8221;text\/css&#8221;&gt;<br \/>\n\t\t\t@import url(http:\/\/fonts.googleapis.com\/css?family=&#8217;.$google_font.&#8217;);<br \/>\n\t\t\t&lt;\/style&gt;<br \/>\n\t\t\t\t&lt;div id=&#8221;&#8216;.$box.'&#8221; class=&#8221;rakib-dev rakib-dev-first&#8221;&gt;<br \/>\n                    &lt;img src=&#8221;&#8216;.$info[&#8216;imgup_1&#8217;].'&#8221; \/&gt;<br \/>\n                    \t&lt;div class=&#8221;mask&#8221;&gt;<br \/>\n                    \t&lt;h2&gt;&#8217;.$info[&#8216;title&#8217;].'&lt;\/h2&gt;<br \/>\n\t\t\t\t\t\t\t\t&lt;p&gt;&#8217;.$info[&#8216;desc&#8217;].'&lt;\/p&gt;<br \/>\n\t\t\t\t\t\t<a href=\"http:\/\/www.youtube.com\/watch?v='.$info['link'].'\" rel=\"wp-video-lightbox\">&#8216;.$info[&#8216;link_title&#8217;].&#8217;<\/a><br \/>\n\t\t\t\t\t   &lt;\/div&gt;<br \/>\n\t\t\t\t\t   &lt;h2&gt;&#8217;.$info[&#8216;ttext&#8217;].'&lt;\/h2&gt;<br \/>\n\t\t\t\t\t   &lt;p&gt;&#8217;.$info[&#8216;textf&#8217;].'&lt;\/p&gt;<br \/>\n\t\t\t\t&lt;\/div&gt;<br \/>\n\t\t\t\t&#8216;<br \/>\n\t\t\t\t;<\/p>\n<p>\t\t\t\t}<br \/>\n\t\tif ($x == 4)<br \/>\n\t\t\t$x = 1;<br \/>\n\t\telse<br \/>\n\t\t\t$x++;<\/ul>\n","protected":false},"template":"","class_list":["post-54188","topic","type-topic","status-publish","hentry","topic-tag-automatica","topic-tag-box","topic-tag-loop","topic-tag-paginacao"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/54188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/54188\/revisions"}],"wp:attachment":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=54188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}