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


PHP TC_utils::tc_get_layout方法代码示例

本文整理汇总了PHP中TC_utils::tc_get_layout方法的典型用法代码示例。如果您正苦于以下问题:PHP TC_utils::tc_get_layout方法的具体用法?PHP TC_utils::tc_get_layout怎么用?PHP TC_utils::tc_get_layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TC_utils的用法示例。


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

示例1: tc_sidebar_display

        /**
         * Displays the sidebar or the front page featured pages area
         * If no widgets are set, displays a placeholder
         *
         * @param Name of the widgetized area
         * @package Customizr
         * @since Customizr 1.0
         */
        function tc_sidebar_display()
        {
            //first check if home and no content option is choosen
            if (tc__f('__is_home_empty')) {
                return;
            }
            //gets current screen layout
            $screen_layout = TC_utils::tc_get_layout(TC_utils::tc_id(), 'sidebar');
            // GY: add relative right and left for LTR/RTL sites
            $rel_left = is_rtl() ? 'right' : 'left';
            $rel_right = is_rtl() ? 'left' : 'right';
            //gets position from current hook and checks the context
            $position = apply_filters('tc_sidebar_position', strpos(current_filter(), 'before') ? $rel_left : $rel_right);
            if ('left' == $position && $screen_layout != 'l' && $screen_layout != 'b') {
                return;
            }
            if ('right' == $position && $screen_layout != 'r' && $screen_layout != 'b') {
                return;
            }
            //gets the global layout settings
            $global_layout = apply_filters('tc_global_layout', TC_init::$instance->global_layout);
            $sidebar_layout = $global_layout[$screen_layout];
            //defines the sidebar wrapper class
            $class = implode(" ", apply_filters("tc_{$position}_sidebar_class", array($sidebar_layout['sidebar'], $position, 'tc-sidebar')));
            ob_start();
            ?>

        <div class="<?php 
            echo $class;
            ?>
">
           <div id="<?php 
            echo $position;
            ?>
" class="widget-area" role="complementary">
              <?php 
            do_action("__before_{$position}_sidebar");
            ##hook of social icons
            if (is_active_sidebar($position)) {
                get_sidebar($position);
            } else {
                $this->tc_display_sidebar_placeholder($position);
            }
            do_action("__after_{$position}_sidebar");
            ?>
            </div><!-- #left or #right-->
        </div><!--.tc-sidebar -->

        <?php 
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_sidebar_display', $html, $sidebar_layout, $position);
        }
开发者ID:LSYanJun,项目名称:wordpress,代码行数:63,代码来源:class-content-sidebar.php

示例2: tc_set_body_classes

 /**
  * Adds various classes on the body element.
  * hook body_class
  *
  * @package Customizr
  * @since Customizr 3.2.0
  */
 function tc_set_body_classes($_classes)
 {
     if (0 != esc_attr(TC_utils::$inst->tc_opt('tc_link_hover_effect'))) {
         array_push($_classes, 'tc-fade-hover-links');
     }
     if (TC___::$instance->tc_is_customizing()) {
         array_push($_classes, 'is-customizing');
     }
     if (wp_is_mobile()) {
         array_push($_classes, 'tc-is-mobile');
     }
     if (0 != esc_attr(TC_utils::$inst->tc_opt('tc_enable_dropcap'))) {
         array_push($_classes, esc_attr(TC_utils::$inst->tc_opt('tc_dropcap_design')));
     }
     //adds the layout
     $_layout = TC_utils::tc_get_layout(get_the_ID(), 'sidebar');
     if (in_array($_layout, array('b', 'l', 'r', 'f'))) {
         array_push($_classes, sprintf('tc-%s-sidebar', 'f' == $_layout ? 'no' : $_layout));
     }
     return $_classes;
 }
开发者ID:un1coin,项目名称:ovn-space,代码行数:28,代码来源:class-fire-init.php

示例3: tc_mainwrapper_start

    /**
    * CUSTOMIZR WRAPPERS
    * print the customizr wrappers
    *
    * @since 3.3+
    *
    * originally used for woocommerce compatibility
    */
    function tc_mainwrapper_start() {
      ?>
      <div id="main-wrapper" class="<?php echo implode(' ', apply_filters( 'tc_main_wrapper_classes' , array('container') ) ) ?>">

        <?php do_action( '__before_main_container' ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need! ?>

        <div class="container" role="main">
          <div class="<?php echo implode(' ', apply_filters( 'tc_column_content_wrapper_classes' , array('row' ,'column-content-wrapper') ) ) ?>">

            <?php do_action( '__before_article_container'); ##hook of left sidebar?>

              <div id="content" class="<?php echo implode(' ', apply_filters( 'tc_article_container_class' , array( TC_utils::tc_get_layout( TC_utils::tc_id() , 'class' ) , 'article-container' ) ) ) ?>">

                <?php do_action ('__before_loop');##hooks the header of the list of post : archive, search... ?>
      <?php
    }
开发者ID:niamherinoc,项目名称:rctractors,代码行数:24,代码来源:class-fire-plugins_compat.php

示例4: tc_get_grid_cols

 private function tc_get_grid_cols() {
   return apply_filters( 'tc_get_grid_cols',
     esc_attr( TC_utils::$inst->tc_opt( 'tc_grid_columns') ),
     TC_utils::tc_get_layout( $this -> post_id , 'class' )
   );
 }
开发者ID:niamherinoc,项目名称:rctractors,代码行数:6,代码来源:class-content-post_list_grid.php

示例5: tc_enqueue_front_scripts

 /**
  * Loads Customizr front scripts
  * Dependencies are defined in the script map property
  *
  * @return  void()
  * @uses wp_enqueue_script() to manage script dependencies
  * @package Customizr
  * @since Customizr 1.0
  */
 function tc_enqueue_front_scripts()
 {
     //wp scripts
     if (is_singular() && get_option('thread_comments')) {
         wp_enqueue_script('comment-reply');
     }
     wp_enqueue_script('jquery');
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('modernizr', TC_BASE_URL . 'inc/assets/js/modernizr.min.js', array(), CUSTOMIZR_VER, isset($_SERVER['HTTP_USER_AGENT']) && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') ? false : true);
     //customizr scripts and libs
     if ($this->tc_load_concatenated_front_scripts()) {
         if ($this->tc_is_fancyboxjs_required()) {
             $this->tc_enqueue_script('tc-fancybox');
         }
         //!!tc-scripts includes underscore, tc-js-arraymap-proto
         $this->tc_enqueue_script('tc-scripts');
     } else {
         wp_enqueue_script('underscore');
         //!!mind the dependencies
         $this->tc_enqueue_script(array('tc-js-params', 'tc-js-arraymap-proto', 'tc-img-original-sizes', 'tc-bootstrap', 'tc-smoothscroll'));
         if ($this->tc_is_fancyboxjs_required()) {
             $this->tc_enqueue_script('tc-fancybox');
         }
         $this->tc_enqueue_script(array('tc-dropcap', 'tc-img-smartload', 'tc-ext-links', 'tc-center-images', 'tc-main-front'));
     }
     //end of load concatenate script if
     //carousel options
     //gets slider options if any for home/front page or for others posts/pages
     $js_slidername = tc__f('__is_home') ? TC_utils::$inst->tc_opt('tc_front_slider') : get_post_meta(TC_utils::tc_id(), $key = 'post_slider_key', $single = true);
     $js_sliderdelay = tc__f('__is_home') ? TC_utils::$inst->tc_opt('tc_slider_delay') : get_post_meta(TC_utils::tc_id(), $key = 'slider_delay_key', $single = true);
     //has the post comments ? adds a boolean parameter in js
     global $wp_query;
     $has_post_comments = 0 != $wp_query->post_count && comments_open() && get_comments_number() != 0 ? true : false;
     //adds the jquery effect library if smooth scroll is enabled => easeOutExpo effect
     $anchor_smooth_scroll = false != esc_attr(TC_utils::$inst->tc_opt('tc_link_scroll')) ? 'easeOutExpo' : 'linear';
     if (false != esc_attr(TC_utils::$inst->tc_opt('tc_link_scroll'))) {
         wp_enqueue_script('jquery-effects-core');
     }
     $anchor_smooth_scroll_exclude = apply_filters('tc_anchor_smoothscroll_excl', array('simple' => array('[class*=edd]', '.tc-carousel-control', '.carousel-control', '[data-toggle="modal"]', '[data-toggle="dropdown"]', '[data-toggle="tooltip"]', '[data-toggle="popover"]', '[data-toggle="collapse"]', '[data-toggle="tab"]', '[class*=upme]', '[class*=um-]'), 'deep' => array('classes' => array(), 'ids' => array())));
     $smooth_scroll_enabled = apply_filters('tc_enable_smoothscroll', !wp_is_mobile() && 1 == esc_attr(TC_utils::$inst->tc_opt('tc_smoothscroll')));
     $smooth_scroll_options = apply_filters('tc_smoothscroll_options', array());
     //smart load
     $smart_load_enabled = esc_attr(TC_utils::$inst->tc_opt('tc_img_smart_load'));
     $smart_load_opts = apply_filters('tc_img_smart_load_options', array('parentSelectors' => array('.article-container', '.__before_main_wrapper', '.widget-front'), 'opts' => array('excludeImg' => array('.tc-holder-img'))));
     //gets current screen layout
     $screen_layout = TC_utils::tc_get_layout(TC_utils::tc_id(), 'sidebar');
     //gets the global layout settings
     $global_layout = apply_filters('tc_global_layout', TC_init::$instance->global_layout);
     $sidebar_layout = isset($global_layout[$screen_layout]['sidebar']) ? $global_layout[$screen_layout]['sidebar'] : false;
     //Gets the left and right sidebars class for js actions
     $left_sb_class = sprintf('.%1$s.left.tc-sidebar', false != $sidebar_layout ? $sidebar_layout : 'span3');
     $right_sb_class = sprintf('.%1$s.right.tc-sidebar', false != $sidebar_layout ? $sidebar_layout : 'span3');
     wp_localize_script($this->tc_load_concatenated_front_scripts() ? 'tc-scripts' : 'tc-js-params', 'TCParams', apply_filters('tc_customizr_script_params', array('_disabled' => apply_filters('tc_disabled_front_js_parts', array()), 'FancyBoxState' => $this->tc_is_fancyboxjs_required(), 'FancyBoxAutoscale' => 1 == TC_utils::$inst->tc_opt('tc_fancybox_autoscale') ? true : false, 'SliderName' => $js_slidername, 'SliderDelay' => $js_sliderdelay, 'SliderHover' => apply_filters('tc_stop_slider_hover', true), 'centerSliderImg' => esc_attr(TC_utils::$inst->tc_opt('tc_center_slider_img')), 'SmoothScroll' => array('Enabled' => $smooth_scroll_enabled, 'Options' => $smooth_scroll_options), 'anchorSmoothScroll' => $anchor_smooth_scroll, 'anchorSmoothScrollExclude' => $anchor_smooth_scroll_exclude, 'ReorderBlocks' => esc_attr(TC_utils::$inst->tc_opt('tc_block_reorder')), 'centerAllImg' => esc_attr(TC_utils::$inst->tc_opt('tc_center_img')), 'HasComments' => $has_post_comments, 'LeftSidebarClass' => $left_sb_class, 'RightSidebarClass' => $right_sb_class, 'LoadModernizr' => apply_filters('tc_load_modernizr', true), 'stickyCustomOffset' => apply_filters('tc_sticky_custom_offset', array("_initial" => 0, "_scrolling" => 0, "options" => array("_static" => true, "_element" => ""))), 'stickyHeader' => esc_attr(TC_utils::$inst->tc_opt('tc_sticky_header')), 'dropdowntoViewport' => esc_attr(TC_utils::$inst->tc_opt('tc_menu_resp_dropdown_limit_to_viewport')), 'timerOnScrollAllBrowsers' => apply_filters('tc_timer_on_scroll_for_all_browser', true), 'extLinksStyle' => esc_attr(TC_utils::$inst->tc_opt('tc_ext_link_style')), 'extLinksTargetExt' => esc_attr(TC_utils::$inst->tc_opt('tc_ext_link_target')), 'extLinksSkipSelectors' => apply_filters('tc_ext_links_skip_selectors', array('classes' => array('btn', 'button'), 'ids' => array())), 'dropcapEnabled' => esc_attr(TC_utils::$inst->tc_opt('tc_enable_dropcap')), 'dropcapWhere' => array('post' => esc_attr(TC_utils::$inst->tc_opt('tc_post_dropcap')), 'page' => esc_attr(TC_utils::$inst->tc_opt('tc_page_dropcap'))), 'dropcapMinWords' => esc_attr(TC_utils::$inst->tc_opt('tc_dropcap_minwords')), 'dropcapSkipSelectors' => apply_filters('tc_dropcap_skip_selectors', array('tags' => array('IMG', 'IFRAME', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'BLOCKQUOTE', 'UL', 'OL'), 'classes' => array('btn'), 'id' => array())), 'imgSmartLoadEnabled' => $smart_load_enabled, 'imgSmartLoadOpts' => $smart_load_opts, 'goldenRatio' => apply_filters('tc_grid_golden_ratio', 1.618), 'gridGoldenRatioLimit' => esc_attr(TC_utils::$inst->tc_opt('tc_grid_thumb_height')), 'isSecondMenuEnabled' => TC_utils::$inst->tc_is_secondary_menu_enabled(), 'secondMenuRespSet' => esc_attr(TC_utils::$inst->tc_opt('tc_second_menu_resp_setting'))), TC_utils::tc_id()));
     //fancybox style
     if ($this->tc_is_fancyboxjs_required()) {
         wp_enqueue_style('fancyboxcss', TC_BASE_URL . 'inc/assets/js/fancybox/jquery.fancybox-1.3.4.min.css');
     }
     //holder.js is loaded when featured pages are enabled AND FP are set to show images and at least one holder should be displayed.
     $tc_show_featured_pages = class_exists('TC_featured_pages') && TC_featured_pages::$instance->tc_show_featured_pages();
     if (0 != $tc_show_featured_pages && $this->tc_maybe_is_holder_js_required()) {
         wp_enqueue_script('holder', sprintf('%1$sinc/assets/js/holder.min.js', TC_BASE_URL), array(), CUSTOMIZR_VER, $in_footer = true);
     }
     //load retina.js in footer if enabled
     if (apply_filters('tc_load_retinajs', 1 == TC_utils::$inst->tc_opt('tc_retina_support'))) {
         wp_enqueue_script('retinajs', TC_BASE_URL . 'inc/assets/js/retina.min.js', array(), CUSTOMIZR_VER, $in_footer = true);
     }
     //Load hammer.js for mobile
     if (apply_filters('tc_load_hammerjs', wp_is_mobile())) {
         wp_enqueue_script('hammer', TC_BASE_URL . 'inc/assets/js/hammer.min.js', array('jquery'), CUSTOMIZR_VER);
     }
 }
开发者ID:ravenvn,项目名称:sandau,代码行数:80,代码来源:class-fire-resources.php

示例6: page

##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need!
?>

    <div class="container" role="main">
        <div class="<?php 
echo implode(' ', apply_filters('tc_column_content_wrapper_classes', array('row', 'column-content-wrapper')));
?>
">

            <?php 
do_action('__before_article_container');
##hook of left sidebar
?>

                <div id="content" class="<?php 
echo implode(' ', apply_filters('tc_article_container_class', array(TC_utils::tc_get_layout(TC_utils::tc_id(), 'class'), 'article-container')));
?>
">

                    <?php 
do_action('__before_loop');
##hooks the heading of the list of post : archive, search...
?>

                        <?php 
if (tc__f('__is_no_results') || is_404()) {
    ##no search results or 404 cases
    ?>

                            <article <?php 
    tc__f('__article_selectors');
开发者ID:ravenvn,项目名称:sandau,代码行数:31,代码来源:index.php

示例7: get_header

<?php
/*
Page Name: Imdex
*/

get_header(); ?>

<div id="main-wrapper" class="container">

    <div class="container" role="main">
        <div class="<?php echo implode(' ', apply_filters( 'tc_column_content_wrapper_classes' , array('row' ,'column-content-wrapper') ) ) ?>">

            <div id="content" class="<?php echo implode(' ', apply_filters( 'tc_article_container_class' , array( TC_utils::tc_get_layout( TC_utils::tc_id() , 'class' ) , 'article-container' ) ) ) ?>">

                <?php do_action ('__before_loop');##hooks the heading of the list of post : archive, search... ?>

                <?php if ( tc__f('__is_no_results') || is_404() ) : ##no search results or 404 cases ?>

                <article <?php tc__f('__article_selectors') ?>>
                    <?php do_action( '__loop' ); ?>
                </article>

            <?php endif; ?>

            <?php if ( have_posts() && ! is_404() ) : ?>
            <?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
            <?php the_post(); ?>

            <?php do_action ('__before_article') ?>
            <article <?php tc__f('__article_selectors') ?>>
                <?php do_action( '__loop' ); ?>
开发者ID:niamherinoc,项目名称:rctractors,代码行数:31,代码来源:index.php


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