[theme-reviewers] Feedback on use of query_posts please - Bad idea?

Zulfikar Nore zulfikarnore at live.com
Sat Sep 14 01:48:35 UTC 2013


I'm using the index.php showing featured content at the top followed by the blog feed - which works fine and I had planned to stick with that. But I've had a lot of requests for options to hide certain sections and one of them was the blog feed on front page.
template.blog.php is to open the option to still have a page with the blog feed on it when the user has opted to hide them on the front.
Long story short - user hides posts on front but still wants a blog fed page and this is my attempt to fill that need.

Date: Fri, 13 Sep 2013 21:42:43 -0400
From: chip at chipbennett.net
To: theme-reviewers at lists.wordpress.org
Subject: Re: [theme-reviewers] Feedback on use of query_posts please - Bad	idea?

Why do you need template-blog.php when there is home.php for exactly that purpose?

On Fri, Sep 13, 2013 at 8:22 PM, Zulfikar Nore <zulfikarnore at live.com> wrote:




I've read around that using query_posts is bad but I've seen many a themes using it and get away with it.
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:

add_filter('option_show_on_front', '__return_false');  global $wp_query;    query_posts(array(	   'paged' => $wp_query->get('paged'),
	   'post__not_in' => get_option('sticky_posts'),    ));
  global $more; $more = 0;    get_template_part('index-blog');
       $more = 1;remove_filter('option_show_on_front', '__return_false');
   wp_reset_query();wp_reset_postdata();
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?

Thanks in advance,Zulf  		 	   		  

_______________________________________________

theme-reviewers mailing list

theme-reviewers at lists.wordpress.org

http://lists.wordpress.org/mailman/listinfo/theme-reviewers





_______________________________________________
theme-reviewers mailing list
theme-reviewers at lists.wordpress.org
http://lists.wordpress.org/mailman/listinfo/theme-reviewers 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20130914/2d7f92a6/attachment.html>


More information about the theme-reviewers mailing list