<div dir="ltr"><div><div>Using `WP_Query` is always going to be much better ...<br><br></div>... here's another example, although from one of my plugins, it is used to create a complete loop for the plugin's output: <br>
<br><a href="https://github.com/Cais/bns-featured-category/blob/master/bns-featured-category.php#L249">https://github.com/Cais/bns-featured-category/blob/master/bns-featured-category.php#L249</a><br><br></div>That is the actual call to `WP_Query` you can see above where its arguments are generated and below where it is used.<br>
</div><div class="gmail_extra"><br clear="all"><div>Edward Caissie<br>aka Cais.</div>
<br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 8:51 PM, Zulfikar Nore <span dir="ltr"><<a href="mailto:zulfikarnore@live.com" target="_blank">zulfikarnore@live.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Sound advice there, cheers :)<div><br></div><div>And that link sets me off in the right direction, thanks for the share.<br><br><div><hr>From: <a href="mailto:philip@frumph.net" target="_blank">philip@frumph.net</a><br>
To: <a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>Date: Fri, 13 Sep 2013 17:38:49 -0700<br>Subject: Re: [theme-reviewers] Feedback on use of query_posts please - Bad idea?<div>
<div class="h5"><br><br>
<div dir="ltr">
<div style="font-size:12pt;font-family:'Calibri'">
<div>You probably should be using new $wp_query</div>
<div> </div>
<div>mines not the best but here’s my blog.php</div>
<div> </div>
<div><a title="https://github.com/Frumph/comicpress/blob/master/blog.php" href="https://github.com/Frumph/comicpress/blob/master/blog.php" target="_blank">https://github.com/Frumph/comicpress/blob/master/blog.php</a></div>
<div> </div>
<div> </div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">
<div style="FONT:10pt tahoma">
<div> </div>
<div style="BACKGROUND:#f5f5f5">
<div><b>From:</b> <a title="zulfikarnore@live.com" href="mailto:zulfikarnore@live.com" target="_blank">Zulfikar Nore</a> </div>
<div><b>Sent:</b> Friday, September 13, 2013 5:22 PM</div>
<div><b>To:</b> <a title="theme-reviewers@lists.wordpress.org" href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">Theme Reviewers</a> </div>
<div><b>Subject:</b> [theme-reviewers] Feedback on use of query_posts please -
Bad idea?</div></div></div>
<div> </div></div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">
<div dir="ltr">I've read around that using query_posts is bad but I've seen many a
themes using it and get away with it.
<div> </div>
<div>My case is I'm trying to put together a template-blog.php for StrapVert and
this is what I've come up with so far:</div>
<div> </div>
<div>
<div>add_filter('option_show_on_front', '__return_false');</div>
<div> global $wp_query;</div>
<div> query_posts(array(</div>
<div><span style="white-space:pre-wrap"></span> 'paged'
=> $wp_query->get('paged'),</div>
<div><span style="white-space:pre-wrap"></span>
'post__not_in' => get_option('sticky_posts'),</div>
<div> ));</div>
<div> </div>
<div> global $more; $more = 0;</div>
<div> get_template_part('index-blog');</div>
<div> $more = 1;</div>
<div>remove_filter('option_show_on_front', '__return_false');</div>
<div> </div>
<div> wp_reset_query();</div>
<div>wp_reset_postdata();</div></div>
<div> </div>
<div>But before I add these changes to the theme and submit an update I'd like
some feedback on "How Really Bad" is query_posts and can I "get away" with the
above?</div>
<div> </div>
<div>Thanks in advance,</div>
<div>Zulf </div></div>
<br><hr>
_______________________________________________<br>theme-reviewers mailing
list<br><a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br><a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div></div>
<br>_______________________________________________
theme-reviewers mailing list
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a></div></div></div></div> </div></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>