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


PHP TC_utils::tc_id方法代码示例

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


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

        function tc_set_grid_hooks(){
          if ( ! apply_filters( 'tc_set_grid_hooks' , $this -> tc_is_grid_enabled() ) )
              return;

          $this -> post_id = TC_utils::tc_id();

          do_action( '__post_list_grid' );
          //Disable icon titles
          //add_filter( 'tc_archive_icon'             , '__return_false', 50 );
          add_filter( 'tc_content_title_icon'       , '__return_false', 50 );
          //icon option
          add_filter( 'tc-grid-thumb-html'          , array( $this, 'tc_set_grid_icon_visibility') );
          //Layout filter
          add_filter( 'tc_get_grid_cols'            , array( $this, 'tc_set_grid_section_cols'), 20 , 2 );
          //pre loop hooks
          add_action( '__before_article_container'  , array( $this, 'tc_set_grid_before_loop_hooks'), 5 );
          //loop hooks
          add_action( '__before_loop'               , array( $this, 'tc_set_grid_loop_hooks'), 0 );
        }
开发者ID:niamherinoc,项目名称:rctractors,代码行数:19,代码来源:class-content-post_list_grid.php

示例3: tc_render_thumb_view

    /**
    * Display or return the thumbnail view
    * @param : thumbnail model (img, width, height), layout value, echo bool
    * @package Customizr
    * @since Customizr 3.0.10
    */
    function tc_render_thumb_view( $_thumb_model , $layout = 'span3', $_echo = true ) {
      if ( empty( $_thumb_model ) )
        return;
      //extract "tc_thumb" , "tc_thumb_height" , "tc_thumb_width"
      extract( $_thumb_model );
      $thumb_img        = ! isset( $_thumb_model) ? false : $tc_thumb;
      $thumb_img        = apply_filters( 'tc_post_thumb_img', $thumb_img, TC_utils::tc_id() );
      if ( ! $thumb_img )
        return;

      //handles the case when the image dimensions are too small
      $thumb_size       = apply_filters( 'tc_thumb_size' , TC_init::$instance -> tc_thumb_size, TC_utils::tc_id()  );
      $no_effect_class  = ( isset($tc_thumb) && isset($tc_thumb_height) && ( $tc_thumb_height < $thumb_size['height']) ) ? 'no-effect' : '';
      $no_effect_class  = ( esc_attr( TC_utils::$inst->tc_opt( 'tc_center_img') ) || ! isset($tc_thumb) || empty($tc_thumb_height) || empty($tc_thumb_width) ) ? '' : $no_effect_class;

      //default hover effect
      $thumb_wrapper    = sprintf('<div class="%5$s %1$s"><div class="round-div"></div><a class="round-div %1$s" href="%2$s" title="%3$s"></a>%4$s</div>',
                                    implode( " ", apply_filters( 'tc_thumbnail_link_class', array( $no_effect_class ) ) ),
                                    get_permalink( get_the_ID() ),
                                    esc_attr( strip_tags( get_the_title( get_the_ID() ) ) ),
                                    $thumb_img,
                                    implode( " ", apply_filters( 'tc_thumb_wrapper_class', array('thumb-wrapper') ) )
      );

      $thumb_wrapper    = apply_filters_ref_array( 'tc_post_thumb_wrapper', array( $thumb_wrapper, $thumb_img, TC_utils::tc_id() ) );

      //cache the thumbnail view
      $html             = sprintf('<section class="tc-thumbnail %1$s">%2$s</section>',
        apply_filters( 'tc_post_thumb_class', $layout ),
        $thumb_wrapper
      );
      $html = apply_filters_ref_array( 'tc_render_thumb_view', array( $html, $_thumb_model, $layout ) );
      if ( ! $_echo )
        return $html;
      echo $html;
    }//end of function
开发者ID:niamherinoc,项目名称:rctractors,代码行数:42,代码来源:class-content-post_thumbnails.php

示例4: 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

示例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: 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(TC_utils::tc_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:joseclavijo,项目名称:gsclube,代码行数:28,代码来源:class-fire-init.php

示例7: 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

示例8: tc_post_nav

        /**
         * The template part for displaying nav links
         *
         * @package Customizr
         * @since Customizr 3.0
         */
        function tc_post_nav()
        {
            // When do we display navigation ?
            //1) we don"t show post navigation for pages by default
            //2) + filter conditions
            $post_navigation_bool = is_page(TC_utils::tc_id()) ? false : true;
            $prev_arrow = is_rtl() ? '&rarr;' : '&larr;';
            $next_arrow = is_rtl() ? '&larr;' : '&rarr;';
            if (!apply_filters('tc_show_post_navigation', $post_navigation_bool)) {
                return;
            }
            global $wp_query;
            $html_id = 'nav-below';
            ob_start();
            ?>

        <?php 
            if (is_singular()) {
                ?>

          <?php 
                echo apply_filters('tc_singular_nav_separator', '<hr class="featurette-divider ' . current_filter() . '">');
                ?>

          <nav id="<?php 
                echo $html_id;
                ?>
" class="navigation" role="navigation">

              <h3 class="assistive-text">
                <?php 
                echo apply_filters('tc_singular_nav_title', __('Post navigation', 'customizr'));
                ?>
              </h3>

              <ul class="pager">
                <?php 
                if (get_previous_post() != null) {
                    ?>
                  <li class="previous">
                    <span class="nav-previous">
                      <?php 
                    $singular_nav_previous_text = apply_filters('tc_singular_nav_previous_text', _x($prev_arrow, 'Previous post link', 'customizr'));
                    $previous_post_link_args = apply_filters('tc_previous_single_post_link_args', array('format' => '%link', 'link' => '<span class="meta-nav">' . $singular_nav_previous_text . '</span> %title', 'in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category'));
                    extract($previous_post_link_args, EXTR_OVERWRITE);
                    previous_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
                    ?>
                    </span>
                  </li>
                <?php 
                }
                ?>
                <?php 
                if (get_next_post() != null) {
                    ?>
                  <li class="next">
                    <span class="nav-next">
                        <?php 
                    $singular_nav_next_text = apply_filters('tc_singular_nav_next_text', _x($next_arrow, 'Next post link', 'customizr'));
                    $next_post_link_args = apply_filters('tc_next_single_post_link_args', array('format' => '%link', 'link' => '%title <span class="meta-nav">' . $singular_nav_next_text . '</span>', 'in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category'));
                    extract($next_post_link_args, EXTR_OVERWRITE);
                    next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
                    ?>
                    </span>
                  </li>
                <?php 
                }
                ?>
              </ul>

          </nav><!-- #<?php 
                echo $html_id;
                ?>
 .navigation -->

        <?php 
            } elseif ($wp_query->max_num_pages > 1 && !is_404() && !tc__f('__is_home_empty')) {
                ?>

          <nav id="<?php 
                echo $html_id;
                ?>
" class="navigation" role="navigation">

            <h3 class="assistive-text">
              <?php 
                echo apply_filters('tc_list_nav_title', __('Post navigation', 'customizr'));
                ?>
            </h3>

              <ul class="pager">

                <?php 
                if (get_next_posts_link() != null) {
//.........这里部分代码省略.........
开发者ID:umairriaz90,项目名称:Daschug1,代码行数:101,代码来源:class-content-post_navigation.php

示例9: tc_is_tax_authorized

 /**
  * Helper : check if a given tax is allowed in the post metas or not
  * A tax is authorized if :
  * 1) not in the exclude list
  * 2) AND not private
  *
  * @return boolean (false)
  * @param  $post_type, $_tax_object
  * @package Customizr
  * @since Customizr 3.3+
  *
  */
 public function tc_is_tax_authorized($_tax_object, $post_type)
 {
     $_in_exclude_list = in_array($_tax_object['name'], apply_filters_ref_array('tc_exclude_taxonomies_from_metas', array(array('post_format'), $post_type, TC_utils::tc_id())));
     $_is_private = false === (bool) $_tax_object['public'] && apply_filters_ref_array('tc_exclude_private_taxonomies', array(true, $_tax_object['public'], TC_utils::tc_id()));
     return !$_in_exclude_list && !$_is_private;
 }
开发者ID:mightyx,项目名称:customizr,代码行数:18,代码来源:class-content-post_metas.php

示例10: 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

示例11: tc_get_term_of_tax_type

 /**
  * Helper to return the current post terms of specified taxonomy type : hierarchical or not
  *
  * @return boolean (false) or array
  * @param  boolean : hierarchical or not
  * @package Customizr
  * @since Customizr 3.1.20
  *
  */
 public function tc_get_term_of_tax_type($hierarchical = true)
 {
     //var declaration
     $post_type = get_post_type(TC_utils::tc_id());
     $tax_list = get_object_taxonomies($post_type, 'object');
     $_tax_type_list = array();
     $_tax_type_terms_list = array();
     if (empty($tax_list)) {
         return false;
     }
     //filter the post taxonomies
     while ($el = current($tax_list)) {
         //skip the post format taxinomy
         if (in_array(key($tax_list), apply_filters_ref_array('tc_exclude_taxonomies_from_metas', array(array('post_format'), $post_type, TC_utils::tc_id())))) {
             next($tax_list);
             continue;
         }
         if ((bool) $hierarchical === (bool) $el->hierarchical) {
             $_tax_type_list[key($tax_list)] = $el;
         }
         next($tax_list);
     }
     if (empty($_tax_type_list)) {
         return false;
     }
     //fill the post terms array
     foreach ($_tax_type_list as $tax_name => $data) {
         $_current_tax_terms = get_the_terms(TC_utils::tc_id(), $tax_name);
         //If current post support this tax but no terms has been assigned yet = continue
         if (!$_current_tax_terms) {
             continue;
         }
         while ($term = current($_current_tax_terms)) {
             $_tax_type_terms_list[$term->term_id] = $term;
             next($_current_tax_terms);
         }
     }
     return empty($_tax_type_terms_list) ? false : apply_filters("tc_tax_meta_list", $_tax_type_terms_list, $hierarchical);
 }
开发者ID:umairriaz90,项目名称:Daschug1,代码行数:48,代码来源:class-content-post_metas.php


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