I have a multisite project and have a small problem with static front page/post. In general i am looking for a way to choose a static page/post out of the whole network on my main blog. Now i'm not sure however how this can be done.
As i see it there are three ways to do it:
- Doing an old fashioned redirect to the page in question using header("Location: ");
- Extending, create a settings option and action or finding a plugin which lets me choose a post from any blog on my network.
- Overriding the build in function that chooses the front page and use the switch and restore blog functions to fetch the correct post-ID. If so with what function/tag should i use if that is possible to do it that way?
Which way would you recommend or is there another way to do this?
The code i have (besides the settings-reading extension which workes fine) is as follows:
$get_blog = get_option("listah_static_blogid"); $get_pageid = get_option("listah_static_pageid"); switch_to_blog($get_blog); // Somehow use the get_pageid to display the page in question and set as front_page for main blog restore_current_blog();