本文整理汇总了PHP中td_global::current_template方法的典型用法代码示例。如果您正苦于以下问题:PHP td_global::current_template方法的具体用法?PHP td_global::current_template怎么用?PHP td_global::current_template使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类td_global
的用法示例。
在下文中一共展示了td_global::current_template方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
//set the template id, used to get the template specific settings
$template_id = '404';
td_global::$current_template = $template_id;
td_global::$load_featured_img_from_template = 'full';
//prepare the loop variables
global $loop_module_id, $loop_sidebar_position;
$loop_sidebar_position = 'no_sidebar';
$loop_module_id = td_util::get_option('tds_' . $template_id . '_page_layout', 1);
//module 1 is default
get_header();
?>
<div class="td-main-content-wrap">
<div class="td-container">
<div class="td-pb-row">
<div class="td-pb-span12">
<div class="td-404-title">
<?php
_etd('Ooops... Error 404', TD_THEME_NAME);
?>
</div>
<div class="td-404-sub-title">
<?php
_etd('Sorry, but the page you are looking for doesn_t exist.', TD_THEME_NAME);
?>
</div>
<div class="td-404-sub-sub-title">
<?php
示例2:
<?php
/* Template Name: Pagebuilder + page title */
get_header();
td_global::$current_template = 'page-title-sidebar';
//set the template id, used to get the template specific settings
$template_id = 'page';
$loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos');
//sidebar right is default (empty)
//read the custom single post settings - this setting overids all of them
$td_page = get_post_meta($post->ID, 'td_page', true);
if (!empty($td_page['td_sidebar_position'])) {
$loop_sidebar_position = $td_page['td_sidebar_position'];
}
// sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
$td_sidebar_position = '';
if ($loop_sidebar_position == 'sidebar_left') {
$td_sidebar_position = 'td-sidebar-left';
}
/**
* detect the page builder
*/
$td_use_page_builder = false;
if (method_exists('WPBMap', 'getShortCodes')) {
$td_page_builder_short_codes = array_keys(WPBMap::getShortCodes());
if (td_util::strpos_array($post->post_content, $td_page_builder_short_codes) === true) {
$td_use_page_builder = true;
}
}
//no page builder detected, we load a default page template with sidebar / no sidebar
?>
示例3:
<?php
td_global::$current_template = 'woo_single';
get_header();
//set the template id, used to get the template specific settings
$template_id = 'woo_single';
$loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos');
//sidebar right is default (empty)
// read the custom single post settings - this setting overwrites all of them
// YES! WE USE THE SAME SINGLE POST SETTINGS for woo commerce
$td_post_theme_settings = get_post_meta($post->ID, 'td_post_theme_settings', true);
if (!empty($td_post_theme_settings['td_sidebar_position'])) {
$loop_sidebar_position = $td_post_theme_settings['td_sidebar_position'];
}
// sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
$td_sidebar_position = '';
if ($loop_sidebar_position == 'sidebar_left') {
$td_sidebar_position = 'td-sidebar-left';
}
?>
<div class="td-main-content-wrap td-main-page-wrap">
<div class="td-container <?php
echo $td_sidebar_position;
?>
">
<div class="td-pb-row">
<?php
switch ($loop_sidebar_position) {
case 'sidebar_left':
?>
<div class="td-pb-span8 td-main-content <?php
示例4:
<?php
/* Template Name: Homepage - bg + with article list */
get_header();
td_global::$current_template = 'page-homepage-loop';
global $paged, $loop_module_id, $loop_sidebar_position, $post, $more;
$td_page = get_query_var('page') ? get_query_var('page') : 1;
//rewrite the global var
$td_paged = get_query_var('paged') ? get_query_var('paged') : 1;
//rewrite the global var
//paged works on single pages, page - works on homepage
if ($td_paged > $td_page) {
$paged = $td_paged;
} else {
$paged = $td_page;
}
$list_custom_title_show = true;
//show the article list title by default
$td_homepage_loop_filter = '';
//homepage loop filter metadata
/*
read the settings for the loop
---------------------------------------------------------------------------------------- */
if (!empty($post->ID)) {
td_global::load_single_post($post);
//read the metadata for the post
$td_homepage_loop_filter = get_post_meta($post->ID, 'td_homepage_loop_filter', true);
//it's send to td_data_source
$td_homepage_loop = get_post_meta($post->ID, 'td_homepage_loop', true);
if (!empty($td_homepage_loop['td_layout'])) {
$loop_module_id = $td_homepage_loop['td_layout'];
示例5:
<?php
//for sidebar
td_global::$current_template = 'bbpress';
get_header();
//set the template id, used to get the template specific settings
$template_id = 'bbpress';
$loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos');
//sidebar right is default (empty)
//read the custom single post settings - this setting overids all of them
$td_page = get_post_meta($post->ID, 'td_page', true);
if (!empty($td_page['td_sidebar_position'])) {
$loop_sidebar_position = $td_page['td_sidebar_position'];
}
// sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
$td_sidebar_position = '';
if ($loop_sidebar_position == 'sidebar_left') {
$td_sidebar_position = 'td-sidebar-left';
}
?>
<div class="td-main-content-wrap td-main-page-wrap">
<div class="td-container">
<div class="td-pb-row">
<?php
switch ($loop_sidebar_position) {
default:
?>
<div class="td-pb-span8 td-main-content" role="main" itemscope="itemscope" itemprop="mainContentOfPage" itemtype="<?php
echo td_global::$http_or_https;
?>
示例6:
<?php
td_global::$current_template = 'woo';
get_header();
//set the template id, used to get the template specific settings
$template_id = 'woo';
$loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos');
//sidebar right is default (empty)
// sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
$td_sidebar_position = '';
if ($loop_sidebar_position == 'sidebar_left') {
$td_sidebar_position = 'td-sidebar-left';
}
?>
<div class="td-main-content-wrap td-main-page-wrap">
<div class="td-container">
<div class="td-pb-row">
<?php
switch ($loop_sidebar_position) {
case 'sidebar_left':
?>
<div class="td-pb-span8 td-main-content <?php
echo $td_sidebar_position;
?>
-content" role="main" itemscope="itemscope" itemprop="mainContentOfPage" itemtype="<?php
echo td_global::$http_or_https;
?>
://schema.org/CreativeWork">
<div class="td-ss-main-content">
<?php
//woocommerce_breadcrumb();
示例7:
<?php
/* ----------------------------------------------------------------------------
the page template
*/
td_global::$current_template = 'woocommerce';
get_header();
// test fork radu test 1
//set the template id, used to get the template specific settings
$template_id = 'woo';
$loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos');
//sidebar right is default (empty)
//read the custom single post settings - this setting overids all of them
$td_page = get_post_meta($post->ID, 'td_page', true);
if (!empty($td_page['td_sidebar_position'])) {
$loop_sidebar_position = $td_page['td_sidebar_position'];
}
switch ($loop_sidebar_position) {
case 'sidebar_left':
echo td_page_generator::wrap_start();
?>
<div class="span4 column_container" role="complementary" itemscope="itemscope" itemtype="<?php
echo td_global::$http_or_https;
?>
://schema.org/WPSideBar">
<?php
get_sidebar();
?>
</div>
<div class="span8 column_container td-no-pagination" role="main" itemscope="itemscope" itemprop="mainContentOfPage" itemtype="<?php
echo td_global::$http_or_https;