Create a page for a theme only

I am in the process of creating a wordpress mobile theme for one of my wpmu networks. I have created 2 + pages that show our other sites and a custom login form. Right now i have labeled them page-other-sites.php and page-login.php and created 2 pages in the backend. When you click on the link it loads the page-(slugs).php

Now instead of having to create a page every time is there a way to have my themes function.php file create a set of default pages.?

Related posts

Leave a Reply

1 comment

  1. So instead of creating a theme for it i ended up using the template_redirect with an if statement to check the url for a certain thing.

    function page_redirect() {
        if ($_SERVER['REQUEST_URI'] == $home . '/other-sites')  {
            require(TEMPLATEPATH . '/includes/other-sites.php');
        }
        if ($_SERVER['REQUEST_URI'] == $home . 'login')  {
            require(TEMPLATEPATH . '/includes/login.php');
        }
    }
    add_action('template_redirect', 'page_redirect');
    

    Simply all this does is check to see if the requested URI is wpsite.com/other-sites or wpsite.com/login and if this is true then load this template instead. Since i am using some WordPress features though in these custom templates i have also made a check for the title since WordPress will return a page not found title.