当前位置: 首页>>代码示例>>PHP>>正文


PHP get_taxonomy_template函数代码示例

本文整理汇总了PHP中get_taxonomy_template函数的典型用法代码示例。如果您正苦于以下问题:PHP get_taxonomy_template函数的具体用法?PHP get_taxonomy_template怎么用?PHP get_taxonomy_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_taxonomy_template函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getWpTemplate

function getWpTemplate()
{
    if (defined('WP_USE_THEMES') && WP_USE_THEMES) {
        $template = false;
        if (is_404() && ($template = get_404_template())) {
        } elseif (is_search() && ($template = get_search_template())) {
        } elseif (is_tax() && ($template = get_taxonomy_template())) {
        } elseif (is_front_page() && ($template = get_front_page_template())) {
        } elseif (is_home() && ($template = get_home_template())) {
        } elseif (is_attachment() && ($template = get_attachment_template())) {
        } elseif (is_single() && ($template = get_single_template())) {
        } elseif (is_page() && ($template = get_page_template())) {
        } elseif (is_category() && ($template = get_category_template())) {
        } elseif (is_tag() && ($template = get_tag_template())) {
        } elseif (is_author() && ($template = get_author_template())) {
        } elseif (is_date() && ($template = get_date_template())) {
        } elseif (is_archive() && ($template = get_archive_template())) {
        } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
        } elseif (is_paged() && ($template = get_paged_template())) {
        } else {
            $template = get_index_template();
        }
        return str_replace(ABSPATH, '', $template);
    } else {
        return null;
    }
}
开发者ID:jtomeck,项目名称:jtwebfolio,代码行数:27,代码来源:showThemeFile.php

示例2: load_template

 /**
  * Copy-pasta of wp-includes/template-loader.php
  */
 private function load_template()
 {
     do_action('template_redirect');
     $template = false;
     if (is_404() && ($template = get_404_template())) {
     } elseif (is_search() && ($template = get_search_template())) {
     } elseif (is_front_page() && ($template = get_front_page_template())) {
     } elseif (is_home() && ($template = get_home_template())) {
     } elseif (is_post_type_archive() && ($template = get_post_type_archive_template())) {
     } elseif (is_tax() && ($template = get_taxonomy_template())) {
     } elseif (is_attachment() && ($template = get_attachment_template())) {
         remove_filter('the_content', 'prepend_attachment');
     } elseif (is_single() && ($template = get_single_template())) {
     } elseif (is_page() && ($template = get_page_template())) {
     } elseif (is_category() && ($template = get_category_template())) {
     } elseif (is_tag() && ($template = get_tag_template())) {
     } elseif (is_author() && ($template = get_author_template())) {
     } elseif (is_date() && ($template = get_date_template())) {
     } elseif (is_archive() && ($template = get_archive_template())) {
     } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
     } elseif (is_paged() && ($template = get_paged_template())) {
     } else {
         $template = get_index_template();
     }
     /**
      * Filter the path of the current template before including it.
      *
      * @since 3.0.0
      *
      * @param string $template The path of the template to include.
      */
     if ($template = apply_filters('template_include', $template)) {
         $template_contents = file_get_contents($template);
         $included_header = $included_footer = false;
         if (false !== stripos($template_contents, 'get_header();')) {
             do_action('get_header', null);
             locate_template('header.php', true, false);
             $included_header = true;
         }
         include $template;
         if (false !== stripos($template_contents, 'get_footer();')) {
             do_action('get_footer', null);
             locate_template('footer.php', true, false);
             $included_footer = true;
         }
         if ($included_header && $included_footer) {
             global $wp_scripts;
             $wp_scripts->done = array();
         }
     }
     return;
 }
开发者ID:danielbachhuber,项目名称:unholy,代码行数:55,代码来源:class-unholy-testcase.php

示例3: xtreme_get_template

function xtreme_get_template()
{
    global $wp;
    if (defined('WP_USE_THEMES') && constant('WP_USE_THEMES')) {
        if (is_404() && ($template = get_404_template())) {
            return redefine_pagenow($template);
        } elseif (is_search() && ($template = get_search_template())) {
            return redefine_pagenow($template);
        } elseif (is_tax() && ($template = get_taxonomy_template())) {
            return redefine_pagenow($template);
        } elseif (is_front_page() && ($template = get_front_page_template())) {
            return redefine_pagenow($template);
        } elseif (is_home() && ($template = get_home_template())) {
            return redefine_pagenow($template);
        } elseif (is_attachment() && ($template = get_attachment_template())) {
            return redefine_pagenow($template);
        } elseif (is_single() && ($template = get_single_template())) {
            return redefine_pagenow($template);
        } elseif (is_page() && ($template = get_page_template())) {
            return redefine_pagenow($template);
        } elseif (is_category() && ($template = get_category_template())) {
            return redefine_pagenow($template);
        } elseif (is_tag() && ($template = get_tag_template())) {
            return redefine_pagenow($template);
        } elseif (is_author() && ($template = get_author_template())) {
            return redefine_pagenow($template);
        } elseif (is_date() && ($template = get_date_template())) {
            return redefine_pagenow($template);
        } elseif (is_archive() && ($template = get_archive_template())) {
            return redefine_pagenow($template);
        } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
            return redefine_pagenow($template);
        } elseif (is_paged() && ($template = get_paged_template())) {
            return redefine_pagenow($template);
        } else {
            $template = get_index_template();
            return redefine_pagenow($template);
        }
    }
}
开发者ID:katikos,项目名称:xtreme-one,代码行数:40,代码来源:xtreme-template-loader.php

示例4: choose_template

 /**
  * Get the fork's parent post, set up a query, and load correct template.
  *
  * Duplicates the functionality of /wp-includes/template-loader.php and includes
  * a lot of copypasta, but that's only to ensure that it follows the same logic.
  *
  */
 function choose_template()
 {
     $p = get_queried_object_id();
     if (get_post_type($p) !== 'fork') {
         return;
     }
     $pp = get_post($p)->post_parent;
     $parent = get_post($pp);
     if ($parent->post_type == 'page') {
         $query = array('page_id' => $pp);
     } else {
         $query = array('p' => $pp);
     }
     $t = new WP_Query($query);
     $template = false;
     if ($t->is_404() && ($template = get_404_template())) {
     } elseif ($t->is_search() && ($template = get_search_template())) {
     } elseif ($t->is_tax() && ($template = get_taxonomy_template())) {
     } elseif ($t->is_front_page() && ($template = get_front_page_template())) {
     } elseif ($t->is_home() && ($template = get_home_template())) {
     } elseif ($t->is_attachment() && ($template = get_attachment_template())) {
         remove_filter('the_content', 'prepend_attachment');
     } elseif ($t->is_single() && ($template = get_single_template())) {
     } elseif ($t->is_page && ($template = get_page_template())) {
     } elseif ($t->is_category() && ($template = get_category_template())) {
     } elseif ($t->is_tag() && ($template = get_tag_template())) {
     } elseif ($t->is_author() && ($template = get_author_template())) {
     } elseif ($t->is_date() && ($template = get_date_template())) {
     } elseif ($t->is_archive() && ($template = get_archive_template())) {
     } elseif ($t->is_comments_popup() && ($template = get_comments_popup_template())) {
     } elseif ($t->is_paged() && ($template = get_paged_template())) {
     } else {
         $template = get_index_template();
     }
     if ($template = apply_filters('template_include', $template)) {
         include $template;
     }
     return;
 }
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:46,代码来源:preview.php

示例5: check_template

 function check_template()
 {
     if (is_404() && ($template = get_404_template())) {
         $this->template = $template;
     } elseif (is_search() && ($template = get_search_template())) {
         $this->template = $template;
     } elseif (is_tax() && ($template = get_taxonomy_template())) {
         $this->template = $template;
     } elseif (is_home() && ($template = get_home_template())) {
         $this->template = $template;
     } elseif (is_attachment() && ($template = get_attachment_template())) {
         $this->template = $template;
     } elseif (is_single() && ($template = get_single_template())) {
         $this->template = $template;
     } elseif (is_page() && ($template = get_page_template())) {
         $this->template = $template;
     } elseif (is_category() && ($template = get_category_template())) {
         $this->template = $template;
     } elseif (is_tag() && ($template = get_tag_template())) {
         $this->template = $template;
     } elseif (is_author() && ($template = get_author_template())) {
         $this->template = $template;
     } elseif (is_date() && ($template = get_date_template())) {
         $this->template = $template;
     } elseif (is_archive() && ($template = get_archive_template())) {
         $this->template = $template;
     } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
         $this->template = $template;
     } elseif (is_paged() && ($template = get_paged_template())) {
         $this->template = $template;
     } else {
         $this->template = function_exists('get_index_template') ? get_index_template() : TEMPLATEPATH . "/index.php";
     }
     $this->template = apply_filters('template_include', $this->template);
     // Hook into the footer so we can echo the active template
     add_action('wp_footer', array(&$this, 'show_template'), 100);
 }
开发者ID:ksolomon,项目名称:Solo-Frame,代码行数:37,代码来源:show-template.php

示例6: get_template

 /**
  * Returns current template
  *
  * @return string
  */
 function get_template()
 {
     static $template = null;
     if ($template === null) {
         switch (true) {
             case is_404() && ($template_file = get_404_template()):
             case is_search() && ($template_file = get_search_template()):
             case is_tax() && ($template_file = get_taxonomy_template()):
             case is_front_page() && function_exists('get_front_page_template') && ($template_file = get_front_page_template()):
             case is_home() && ($template_file = get_home_template()):
             case is_attachment() && ($template_file = get_attachment_template()):
             case is_single() && ($template_file = get_single_template()):
             case is_page() && ($template_file = get_page_template()):
             case is_category() && ($template_file = get_category_template()):
             case is_tag() && ($template_file = get_tag_template()):
             case is_author() && ($template_file = get_author_template()):
             case is_date() && ($template_file = get_date_template()):
             case is_archive() && ($template_file = get_archive_template()):
             case is_comments_popup() && ($template_file = get_comments_popup_template()):
             case is_paged() && ($template_file = get_paged_template()):
                 break;
             default:
                 if (function_exists('get_index_template')) {
                     $template_file = get_index_template();
                 } else {
                     $template_file = 'index.php';
                 }
                 break;
         }
         $template = basename($template_file, '.php');
     }
     return $template;
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:38,代码来源:Minify.php

示例7: elseif

    return;
} elseif (is_feed()) {
    do_feed();
    return;
} elseif (is_trackback()) {
    include ABSPATH . 'wp-trackback.php';
    return;
}
if (defined('WP_USE_THEMES') && WP_USE_THEMES) {
    $template = false;
    if (is_404() && ($template = get_404_template())) {
    } elseif (is_search() && ($template = get_search_template())) {
    } elseif (is_front_page() && ($template = get_front_page_template())) {
    } elseif (is_home() && ($template = get_home_template())) {
    } elseif (is_post_type_archive() && ($template = get_post_type_archive_template())) {
    } elseif (is_tax() && ($template = get_taxonomy_template())) {
    } elseif (is_attachment() && ($template = get_attachment_template())) {
        remove_filter('the_content', 'prepend_attachment');
    } elseif (is_single() && ($template = get_single_template())) {
    } elseif (is_page() && ($template = get_page_template())) {
    } elseif (is_category() && ($template = get_category_template())) {
    } elseif (is_tag() && ($template = get_tag_template())) {
    } elseif (is_author() && ($template = get_author_template())) {
    } elseif (is_date() && ($template = get_date_template())) {
    } elseif (is_archive() && ($template = get_archive_template())) {
    } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
    } elseif (is_paged() && ($template = get_paged_template())) {
    } else {
        $template = get_index_template();
    }
    /**
开发者ID:Didox,项目名称:beminfinito,代码行数:31,代码来源:template-loader.php

示例8: templateLoad

 public function templateLoad($defaultView = '')
 {
     global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
     $content = '';
     /**
      * Loads the correct template based on the visitor's url
      * @package WordPress
      */
     if (defined('WP_USE_THEMES') && WP_USE_THEMES) {
         do_action('template_redirect');
     }
     /**
      * Filter whether to allow 'HEAD' requests to generate content.
      *
      * Provides a significant performance bump by exiting before the page
      * content loads for 'HEAD' requests. See #14348.
      *
      * @since 3.5.0
      *
      * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
      */
     if ('HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters('exit_on_http_head', true)) {
         exit;
     }
     // Process feeds and trackbacks even if not using themes.
     if (is_robots()) {
         /**
          * Fired when the template loader determines a robots.txt request.
          *
          * @since 2.1.0
          */
         do_action('do_robots');
         return $content;
     } elseif (is_feed()) {
         do_feed();
         return $content;
     } elseif (is_trackback()) {
         include ABSPATH . 'wp-trackback.php';
         return $content;
     }
     if (defined('WP_USE_THEMES') && WP_USE_THEMES) {
         $template = false;
         if (is_404() && ($template = get_404_template())) {
         } elseif (is_search() && ($template = get_search_template())) {
         } elseif (is_front_page() && ($template = get_front_page_template())) {
         } elseif (is_home() && ($template = get_home_template())) {
         } elseif (is_post_type_archive() && ($template = get_post_type_archive_template())) {
         } elseif (is_tax() && ($template = get_taxonomy_template())) {
         } elseif (is_attachment() && ($template = get_attachment_template())) {
             remove_filter('the_content', 'prepend_attachment');
         } elseif (is_single() && ($template = get_single_template())) {
         } elseif (is_page() && ($template = get_page_template())) {
         } elseif (is_category() && ($template = get_category_template())) {
         } elseif (is_tag() && ($template = get_tag_template())) {
         } elseif (is_author() && ($template = get_author_template())) {
         } elseif (is_date() && ($template = get_date_template())) {
         } elseif (is_archive() && ($template = get_archive_template())) {
         } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
         } elseif (is_paged() && ($template = get_paged_template())) {
         } else {
             $template = get_index_template();
         }
         /**
          * Filter the path of the current template before including it.
          *
          * @since 3.0.0
          *
          * @param string $template The path of the template to include.
          */
         if ($template = apply_filters('template_include', $this->defaultView ?: $template)) {
             load_template($template, false);
         }
         return $content;
     }
 }
开发者ID:ycms,项目名称:module-main,代码行数:75,代码来源:MainController.php

示例9: getContent

 private function getContent()
 {
     $template = false;
     if (is_404() && ($template = get_404_template())) {
     } elseif (is_search() && ($template = get_search_template())) {
     } elseif (is_tax() && ($template = get_taxonomy_template())) {
     } elseif (is_front_page() && ($template = get_front_page_template())) {
     } elseif (is_home() && ($template = get_home_template())) {
     } elseif (is_attachment() && ($template = get_attachment_template())) {
         remove_filter('the_content', 'prepend_attachment');
     } elseif (is_single() && ($template = get_single_template())) {
     } elseif (is_page() && ($template = get_page_template())) {
     } elseif (is_category() && ($template = get_category_template())) {
     } elseif (is_tag() && ($template = get_tag_template())) {
     } elseif (is_author() && ($template = get_author_template())) {
     } elseif (is_date() && ($template = get_date_template())) {
     } elseif (is_archive() && ($template = get_archive_template())) {
     } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
     } elseif (is_paged() && ($template = get_paged_template())) {
     } else {
         $template = get_index_template();
     }
     if ($template = apply_filters('template_include', $template)) {
         ob_start();
         include $template;
         $contents = ob_get_contents();
         ob_end_clean();
         return $contents;
     } else {
         return;
     }
 }
开发者ID:dayax,项目名称:wordpress-test,代码行数:32,代码来源:Client.php

示例10: get_group

 /**
  * Returns current group
  *
  * @return string
  */
 function get_group()
 {
     static $group = null;
     if ($group === null) {
         switch (true) {
             case is_404() && ($template = get_404_template()):
             case is_search() && ($template = get_search_template()):
             case is_tax() && ($template = get_taxonomy_template()):
             case is_home() && ($template = get_home_template()):
             case is_attachment() && ($template = get_attachment_template()):
             case is_single() && ($template = get_single_template()):
             case is_page() && ($template = get_page_template()):
             case is_category() && ($template = get_category_template()):
             case is_tag() && ($template = get_tag_template()):
             case is_author() && ($template = get_author_template()):
             case is_date() && ($template = get_date_template()):
             case is_archive() && ($template = get_archive_template()):
             case is_comments_popup() && ($template = get_comments_popup_template()):
             case is_paged() && ($template = get_paged_template()):
                 $group = basename($template, '.php');
                 break;
             default:
                 $group = 'default';
                 break;
         }
     }
     return $group;
 }
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:33,代码来源:Minify.php

示例11: wps_filter_template_include

 /**
  * Emits template loads to the console
  */
 public function wps_filter_template_include($template)
 {
     if (isset($this->options['no-templates'])) {
         return $template;
     }
     //
     // Try to work out what the template is
     //
     $want_template = '';
     $got_template = '';
     if (is_404()) {
         $want_template = '404';
     } elseif (is_search()) {
         $want_template = 'Search';
     } elseif (is_tax()) {
         $want_template = 'Taxonomy';
     } elseif (is_front_page()) {
         $want_template = 'Front page';
     } elseif (is_home()) {
         $want_template = 'Home';
     } elseif (is_attachment()) {
         $want_template = 'Attachment';
     } elseif (is_single()) {
         $want_template = 'Single';
     } elseif (is_page()) {
         $want_template = 'Page';
     } elseif (is_category()) {
         $want_template = 'Category';
     } elseif (is_tag()) {
         $want_template = 'Tag';
     } elseif (is_author()) {
         $want_template = 'Author';
     } elseif (is_date()) {
         $want_template = 'Date';
     } elseif (is_archive()) {
         $want_template = 'Archive';
     } elseif (is_comments_popup()) {
         $want_template = 'Comments popup';
     } elseif (is_paged()) {
         $want_template = 'Paged';
     }
     if ($template == get_404_template()) {
         $got_template = '404';
     } elseif ($template == get_search_template()) {
         $got_template = 'Search';
     } elseif ($template == get_taxonomy_template()) {
         $got_template = 'Taxonomy';
     } elseif ($template == get_front_page_template()) {
         $got_template = 'Front page';
     } elseif ($template == get_home_template()) {
         $got_template = 'Home';
     } elseif ($template == get_attachment_template()) {
         $got_template = 'Attachment';
     } elseif ($template == get_single_template()) {
         $got_template = 'Single';
     } elseif ($template == get_page_template()) {
         $got_template = 'Page';
     } elseif ($template == get_category_template()) {
         $got_template = 'Category';
     } elseif ($template == get_tag_template()) {
         $got_template = 'Tag';
     } elseif ($template == get_author_template()) {
         $got_template = 'Author';
     } elseif ($template == get_date_template()) {
         $got_template = 'Date';
     } elseif ($template == get_archive_template()) {
         $got_template = 'Archive';
     } elseif ($template == get_comments_popup_template()) {
         $got_template = 'Comments popup';
     } elseif ($template == get_paged_template()) {
         $got_template = 'Paged';
     } elseif ($template == get_index_template()) {
         $got_template = 'Index';
     } else {
         $got_template = 'Unknown';
     }
     $this->message(Colours::fg('yellow') . "Template load: " . Colours::off() . "wanted {$want_template}, got {$got_template} (" . str_replace($this->options['wp-root'] . "/wp-content/", '', $template) . ")");
     return $template;
 }
开发者ID:dxw,项目名称:whippet-server,代码行数:82,代码来源:whippet.class.php

示例12: getDefaultTemplate

 /**
  * @DEPRICATED
  */
 public function getDefaultTemplate($post)
 {
     if ($post->post_status == 'auto-draft') {
         return false;
     }
     $args = array('p' => $post->ID, 'post_type' => $post->post_type);
     if ($post->post_type == 'page') {
         $args = array('page_id' => $post->ID);
     }
     $template = false;
     if (is_404() && ($template = get_404_template())) {
     } elseif (is_search() && ($template = get_search_template())) {
     } elseif (is_tax() && ($template = get_taxonomy_template())) {
     } elseif (is_front_page() && ($template = get_front_page_template())) {
     } elseif (is_home() && ($template = get_home_template())) {
     } elseif (is_attachment() && ($template = get_attachment_template())) {
     } elseif (is_single() && ($template = get_single_template())) {
     } elseif (is_page() && ($template = get_page_template())) {
     } elseif (is_category() && ($template = get_category_template())) {
     } elseif (is_tag() && ($template = get_tag_template())) {
     } elseif (is_author() && ($template = get_author_template())) {
     } elseif (is_date() && ($template = get_date_template())) {
     } elseif (is_archive() && ($template = get_archive_template())) {
     } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
     } elseif (is_paged() && ($template = get_paged_template())) {
     } else {
         $template = get_index_template();
     }
     // wp_reset_query();
     if ($template && is_file($template)) {
         $template = basename($template);
     } else {
         $template = false;
     }
     return $template;
 }
开发者ID:nikolaskarica,项目名称:bds-alliance,代码行数:39,代码来源:gumm_template_builder.php


注:本文中的get_taxonomy_template函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。