{"id":27170,"date":"2013-03-26T12:09:06","date_gmt":"2013-03-26T11:09:06","guid":{"rendered":"https:\/\/pl.wordpress.org\/support\/topic\/duplikowanie-postow-mimo-do_not_duplicate\/"},"modified":"2016-08-05T21:55:15","modified_gmt":"2016-08-05T21:55:15","slug":"duplikowanie-postow-mimo-do_not_duplicate","status":"closed","type":"topic","link":"https:\/\/pl.wordpress.org\/support\/topic\/duplikowanie-postow-mimo-do_not_duplicate\/","title":{"rendered":"Duplikowanie post\u00f3w mimo do_not_duplicate"},"content":{"rendered":"<p>Witam Was serdecznie i z g\u00f3ry dzi\u0119kuj\u0119 za jak\u0105kolwiek pomoc, poniewa\u017c ja grzebie i grzebie w kodzie ju\u017c kilka dni i nie mog\u0119 do tego doj\u015b\u0107.<\/p>\n<p>Posiadam na stronie dwa rodzaje news\u00f3w (featured\/recent). I chcia\u0142bym \u017ceby najpierw wy\u015bwietla\u0142y si\u0119 trzy rodzaje pierwszych, p\u00f3\u017aniej pi\u0119c drugich i tak naprzemian itp..<\/p>\n<pre><code>&lt;?php $my_query = new WP_Query(&#039;showposts=1&#039;);\n  while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();\n  $do_not_duplicate = $post-&gt;ID; ?&gt;\n\n&lt;div class=&quot;featured &lt;?php sandbox_post_class() ?&gt;&quot; &gt;\n&lt;?php include (TEMPLATEPATH . &#039;\/post-image.php&#039;); ?&gt;\n&lt;div class=&quot;bigdate&quot;&gt;&lt;?php the_time(&#039;d.m&#039;); ?&gt;&lt;\/div&gt;\n&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot; class=&quot;post-content&quot;&gt;&lt;?php the_title() ?&gt;&lt;span class=&quot;post-content-excerpt&quot;&gt;&lt;?php the_excerpt(); ?&gt;&lt;\/span&gt;&lt;\/a&gt;\n&lt;\/div&gt;&lt;!-- .featured --&gt;\n\n&lt;?php endwhile; ?&gt;\n\n&lt;div class=&quot;recent&quot;&gt;\n\t&lt;?php query_posts(&#039;showposts=4&#039;); ?&gt;\n\t&lt;?php while (have_posts()) : the_post();\n\t\t  if( $post-&gt;ID == $do_not_duplicate ) continue; update_post_caches($posts); ?&gt;\n\t&lt;div id=&quot;post-&lt;?php the_ID() ?&gt;&quot; class=&quot;&lt;?php sandbox_post_class() ?&gt;&quot;&gt;\n\n\t&lt;?php include (TEMPLATEPATH . &#039;\/post-image.php&#039;); ?&gt;\n\n\t&lt;div class=&quot;bigdate&quot;&gt;&lt;?php the_time(&#039;d.m&#039;); ?&gt;&lt;\/div&gt;\n\t&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot; class=&quot;post-content&quot;&gt;&lt;?php the_title() ?&gt;&lt;span class=&quot;post-content-excerpt&quot;&gt;&lt;?php the_excerpt(); ?&gt;&lt;\/span&gt;&lt;\/a&gt;\n\t&lt;\/div&gt;&lt;!-- .post --&gt;\n\n&lt;?php endwhile ?&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>I je\u015bli po drugiej p\u0119tli (gdzie wy\u015bwietlany jest recent) wrzuc\u0119 ponownie kod z featured wy\u015bwietla pi\u0119knie, tylko jest to zduplikowany post z pierwszej p\u0119tli.<\/p>\n<p>Mog\u0119 liczy\u0107 jako\u015b na Wasz\u0105 pomoc lub wskaz\u00f3wki?<\/p>\n<p>Pozdrawiam serdecznie<\/p>\n","protected":false},"template":"","class_list":["post-27170","topic","type-topic","status-closed","hentry","topic-tag-do_not_duplicate","topic-tag-duplikowanie","topic-tag-posty"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/27170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/27170\/revisions"}],"wp:attachment":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=27170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}