mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Image fu from Andy. fixes #1776
git-svn-id: https://develop.svn.wordpress.org/trunk@2958 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1384,6 +1384,12 @@ function is_page ($page = '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_subpost () {
|
||||
global $wp_query;
|
||||
|
||||
return $wp_query->is_subpost;
|
||||
}
|
||||
|
||||
function is_archive () {
|
||||
global $wp_query;
|
||||
|
||||
@@ -1869,6 +1875,19 @@ function get_single_template() {
|
||||
return get_query_template('single');
|
||||
}
|
||||
|
||||
function get_subpost_template() {
|
||||
global $posts;
|
||||
$type = explode('/', $posts[0]->post_type);
|
||||
if ( $template = get_query_template($type[0]) )
|
||||
return $template;
|
||||
elseif ( $template = get_query_template($type[1]) )
|
||||
return $template;
|
||||
elseif ( $template = get_query_template("$type[0]_$type[1]") )
|
||||
return $template;
|
||||
else
|
||||
return get_query_template('subpost');
|
||||
}
|
||||
|
||||
function get_comments_popup_template() {
|
||||
if ( file_exists( TEMPLATEPATH . '/comments-popup.php') )
|
||||
$template = TEMPLATEPATH . '/comments-popup.php';
|
||||
|
||||
Reference in New Issue
Block a user