Setting up wpmu to automate the Front Page Displays

Hello,

I set up my install of wpmu to automatically create 5 static pages, which it does beautifully. Two of those static pages are titled “Welcome” and “Blogs.” My goal is to then have the system automatically choose the “Welcome” page as the default Front Page and the “Blog” page as the default Posts page. As you know, this can be done manually by the user through “Settings > Reading > Front Page Displays, etc. But my goal is to automate that process. I did try the “New Blog Defaults Plugin” but did not have this feature. Any help would be greatly appreciated. Thanks for your time.

Best,

Terence

  • Hiranthi
    • Recruit

    As can be read in options-reading.php (wp-admin folder), the page and post on front are options (as in: get_option()). Perhaps that knowledge could help you with your solution?

    Both options:

    get_option('page_on_front');
    get_option('page_for_posts');

  • terence
    • Design Lord, Child of Thor

    Thanks for the reply illutic. I was able to configure the options-reading.php page to default to the correct options, however, users still need to manually go in and click “save” in the Reading settings to enact those options. I wish I could get those options to automatically save. Thanks again for any additional help.

  • drmike
    • DEV MAN’s Mascot

    I could have sworn that one of the new default plugin did pages but it appears that they don’t. Strange…

    You can create an additional page during blog setup. To stick a new page in, it’s fairly easy. Open up /wp-includes/wpmu-functions.php and do a search for First Page for how wpmu does it.

    http://trac.mu.wordpress.org/browser/trunk/wp-includes/wpmu-functions.php#L1453

    Just create a plugin and hook into wpmu_new_blog. That’s the hook run during blog creation.

    Hope this helps,

    -drmike

  • terrence
    • WPMU DEV Initiate

    terence I like the name. I would like to create the ability to have blogs created with static pages as you have. Would you mind sharing how you accomplished this. I’m not extremely familiar with PHP but learning. I would like to create several static pages and determine, which Page is the default. Any help you can provide would be great.

    Thanks,

    Terrence

  • terence
    • Design Lord, Child of Thor

    Hi Terrence – I actually just added new pages to the core. As Dr. Mike said, "Open up /wp-includes/wpmu-functions.php and do a search for First Page for how wpmu does it." Then I just copied and pasted the new pages right there in the wpmu-functions.php page. However, a better solution would be to have a plugin do it instead of changing the core. With that said…Dr. Mike (or another programming guru), would you be kind enough to paste the mu-plugin code that would make that happen? Thanks.

    Terence

  • stcwebdesigns
    • Flash Drive

    Hello, first time post from a new subscriber here.

    I’m not sure if you have a protocol for "me too" posts, but I came here looking for precisely what Terence is describing above.

    I’ve managed to create the page (I only need one, unlike Terence) by editing the core, but haven’t managed to make the created page default to appear on the Front automatically.

    A plugin would be much appreciated. Thanks for any help offered.

    Janie