This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pageID = 'page name or slug'; | |
get_ID_by_slug($pageID ); | |
// page id by slug | |
function get_ID_by_slug($page_slug) { | |
$page = get_page_by_path($page_slug); | |
if ($page) { | |
return $page->ID; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Body Class | |
function add_body_class( $classes ) | |
{ | |
global $is_iphone; | |
global $post; | |
if ( isset( $post ) ) { | |
$classes[] = $post->post_type . '-' . $post->post_name; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom Template Inheritance ----------------------------- | |
function custom_template_override () { | |
if( is_page() ) { | |
global $post; | |
if( $post->post_parent ) { | |
$parent_page_template = get_post_meta($post->post_parent,'_wp_page_template',true); | |
$current_page_template = get_post_meta($post->ID, '_wp_page_template' , true ); | |
NewerOlder