[wp-hackers] is_front_page() after modifying query_posts

SWORD Studios info at swordstudios.net
Fri Mar 11 20:37:15 UTC 2011


What if you want to allow the user to select a category as the home page and
wouldn't otherwise know what category that was.
On Mar 11, 2011 3:32 PM, "Austin Matzko" <austin at ilfilosofo.com> wrote:
> On Fri, Mar 11, 2011 at 2:22 PM, Otto <otto at ottodestruct.com> wrote:
>> First, in WP, *all* pages are really "index.php". So I assume you
>> meant for the root page. http://example.com/ for example.
>>
>> Secondly, all the is_whatever() functions are based around the current
>> main query. is_archive() will return true on any archive page.
>> is_category() returns true on any category archive page. is_page(),
>> is_single(), etc., all of them are based on the current query.
>>
>> Now, is_front_page() is also based on the current query, as well as
>> the front page setting on the Settings page. If you change the query
>> to something else, then you're not on the front page anymore.
>
> But unlike is_archive(), is_category(), etc., is_front_page() has no
> reasonable scoped use within a custom query. I may, for example, want
> to know whether the current, custom query is for a category or page,
> no matter that overall page's query was, but there would never be a
> situation in which the custom query result for is_front_page() should
> be different from the main query.
>
> So I think it would be reasonable for is_front_page() the function to
> be an exception to the general rule, and return the value of the
> $wp_the_query method, because it already is exceptional.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list