>
Download This Plugin | |
Download Elegant Themes | |
Name | Default Theme Pages |
Version | 0.4 |
Author | Carlos Sanz García |
Rating | 0 |
Last updated | 2012-08-30 12:55:00 |
Downloads |
1141
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Default Theme Pages plugin added 15 bytes of resources to the Home page and 29 bytes of resources to the sample Post page.
Default Theme Pages plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Default Theme Pages plugin ads no tables to your Wordpress blog database.Add this code in your functions.php.
global $default_theme_pages;
$default_theme_pages = array(
array(
'name' => 'home', // initial slug page / id for templating - access functions
'title' => 'Homepage', // page title
'option' => 'page_on_front', // option page id ( stores the page id in an option, use only in theese cases)
'description' => 'homepage' // description
),
array(
'name' => 'blog',
'title' => 'Blog',
'option' => 'page_for_posts',
'description' => 'blog'
),
array(
'name' => 'contact',
'title' => 'Contact me!',
'description' => 'Contact form page'
)
);
option
names: page_on_front
and page_for_posts
, you will block the home-page and the blog-page on your site.You can template using ID or name (setted up in $default_theme_pages global variable ), something like:
page-131.php or page-contact.php (If you change the page slug, this will still work because 'contact' was defined as pagename if $default_theme_pages global variable).
For detect if you're in that page:
dtp_is_page('contact')
Getting a default page id:
$page_id = dtp_get_page_id('contact');
This method is more quick than get_page_by_path because page ID is stored on global variable.