[wp-hackers] Static Front page setting, accessing from a plugin?

Mike Schinkel mikeschinkel at newclarity.net
Sun Jan 3 23:50:39 UTC 2010


Your answer might be in hooking the 'home_template' hook and routing them to a custom page and/or hooking the 'query' hook and modifying the query. Not sure w/o testing it and ATM no time for that.  Be aware that WordPress processes it's URL as queries so you have to make sure it's processing like you think it should. Have a look at /wp-includes/template-loader.php to understand some of how it routes.

HTH

-Mike


On Jan 3, 2010, at 3:43 PM, John Eckman wrote:

> Hello and happy new year all. 
> 
> Is it possible to access, from inside a plugin, whether the user has set a static homepage, and if so, what they have as their posts-page?
> 
> (I'm talking about the settings in Settings->Reading where you can set a "static page" as the home page and then set another page for use as your posts page).
> 
> I'm working on a plugin where it makes sense that under some conditions you might want to override that "static home page" setting and display the regular "posts page" instead - but I can't see any simple way to do that. 
> 
> It seems that I can check for these two conditional tags: (is_front_page() && (!is_home()))
> 
> Which tells me when I am loading the front page and I'm NOT in the default "list of blog posts" page. (Because is_home will be false on the static front page, but is_front_page will be true). 
> 
> But how can I then "redirect" to what the posts page is, when that condition is true?
> 
> Thanks for any pointers and sorry if I missed an RTFM somewhere . . . 
> 
> 
> ----------------------------------------
> John Eckman
> eckman.john at gmail.com
> 
> 
> 
> 
> 
> _______________________________________________
> 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