/**
         * The default template for displaying single post content
         *
         * @package Customizr
         * @since Customizr 3.0
         */
        function tc_post_content()
        {
            //check conditional tags : we want to show single post or single custom post types
            global $post;
            $tc_show_single_post_content = isset($post) && 'page' != $post->post_type && 'attachment' != $post->post_type && is_singular() && !tc__f('__is_home_empty');
            if (!apply_filters('tc_show_single_post_content', $tc_show_single_post_content)) {
                return;
            }
            //display an icon for div if there is no title
            $icon_class = in_array(get_post_format(), array('quote', 'aside', 'status', 'link')) ? apply_filters('tc_post_format_icon', 'format-icon') : '';
            ob_start();
            do_action('__before_content');
            ?>
    

          <section class="entry-content <?php 
            echo $icon_class;
            ?>
">
              <?php 
            the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'customizr'));
            ?>
              <?php 
            wp_link_pages(array('before' => '<div class="pagination pagination-centered">' . __('Pages:', 'customizr'), 'after' => '</div>'));
            ?>
          </section><!-- .entry-content -->

        <?php 
            do_action('__after_content');
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_post_content', $html);
        }
Ejemplo n.º 2
0
        /**
         * Single post thumbnail view
         *
         * @package Customizr
         * @since Customizr 3.2.0
         */
        function tc_single_post_thumbnail_view()
        {
            $_exploded_location = explode('|', esc_attr(tc__f('__get_option', 'tc_single_post_thumb_location')));
            $_hook = isset($_exploded_location[0]) ? $_exploded_location[0] : '__before_content';
            $_size_to_request = '__before_main_wrapper' == $_hook ? 'slider-full' : 'slider';
            //get the thumbnail data (src, width, height) if any
            $thumb_data = TC_post_thumbnails::$instance->tc_get_thumbnail_data($_size_to_request);
            $_single_thumbnail_wrap_class = implode(" ", apply_filters('tc_single_post_thumb_class', array('row-fluid', 'tc-single-post-thumbnail-wrapper', current_filter())));
            ob_start();
            ?>
            <div class="<?php 
            echo $_single_thumbnail_wrap_class;
            ?>
">
              <?php 
            TC_post_thumbnails::$instance->tc_display_post_thumbnail($thumb_data, 'span12');
            ?>
            </div>
          <?php 
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_single_post_thumbnail_view', $html);
        }
    /**
     * 
     * @package Customizr
     * @since Customizr 1.0 
     */
    function tc_get_breadcrumb()
    {
        $__options = tc__f('__options');
        //get the default layout
        $tc_breadcrumb = $__options['tc_breadcrumb'];
        if ($tc_breadcrumb != 1) {
            return;
        }
        $args = array('container' => 'div', 'separator' => '&raquo;', 'before' => false, 'after' => false, 'front_page' => true, 'show_home' => __('Home', 'customizr'), 'network' => false, 'echo' => true);
        //do not display breadcrumb on home page
        if (is_home() || is_front_page()) {
            return;
        }
        ?>
	        <div class="tc-hot-crumble container" role="navigation">
	          <div class="row">
	            <div class="span12">
	            <?php 
        $this->tc_breadcrumb_trail($args);
        ?>
	            </div>
	          </div>
	        </div>
	        <?php 
    }
Ejemplo n.º 4
0
        /**
         * The template part for displaying page content
         *
         * @package Customizr
         * @since Customizr 3.0
         */
        function tc_page_content() {
            if ( 'page' != tc__f('__post_type') || ! is_singular() || tc__f( '__is_home_empty') )
                return;

            ob_start();

                do_action( '__before_content' );
                ?>

                <div class="entry-content">
                    <?php
                        the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>' , 'customizr' ) );
                        wp_link_pages( array(
                            'before'        => '<div class="btn-toolbar page-links"><div class="btn-group">' . __( 'Pages:' , 'customizr' ),
                            'after'         => '</div></div>',
                            'link_before'   => '<button class="btn btn-small">',
                            'link_after'    => '</button>',
                            'separator'     => '',
                            )
                        );
                    ?>
                </div>

                <?php
                do_action( '__after_content' );

            $html = ob_get_contents();
            if ($html) ob_end_clean();
            echo apply_filters( 'tc_page_content', $html );
        }
 /**
  * 
  * @package Customizr
  * @since Customizr 1.0 
  */
 function tc_breadcrumb_display()
 {
     if (!apply_filters('tc_show_breadcrumb', 1 == tc__f('__get_option', 'tc_breadcrumb') && !tc__f('__is_home'))) {
         return;
     }
     $args = array('container' => 'div', 'separator' => '&raquo;', 'before' => false, 'after' => false, 'front_page' => true, 'show_home' => __('Home', 'customizr'), 'network' => false, 'echo' => true);
     echo apply_filters('tc_breadcrumb_display', sprintf('<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="%1$s">%2$s</div></div></div>', apply_filters('tc_breadcrumb_class', 'span12'), $this->tc_breadcrumb_trail($args)));
 }
 /**
  * Registers and enqueues Customizr stylesheets
  * @package Customizr
  * @since Customizr 1.1
  */
 function tc_customizer_styles()
 {
     wp_register_style('customizr-skin', TC_BASE_URL . 'inc/css/' . tc__f('__get_option', 'tc_skin'), array(), CUSTOMIZR_VER, $media = 'all');
     //enqueue skin
     wp_enqueue_style('customizr-skin');
     //enqueue WP style sheet
     wp_enqueue_style('customizr-style', get_stylesheet_uri(), array('customizr-skin'), CUSTOMIZR_VER, $media = 'all');
 }
 /**
  * 
  * @package Customizr
  * @since Customizr 1.0 
  */
 function tc_breadcrumb_display()
 {
     if (!apply_filters('tc_show_breadcrumb', 1 == tc__f('__get_option', 'tc_breadcrumb') && !tc__f('__is_home'))) {
         return;
     }
     //set the args properties
     $this->args = $this->_get_args();
     echo apply_filters('tc_breadcrumb_display', sprintf('<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="%1$s">%2$s</div></div></div>', apply_filters('tc_breadcrumb_class', 'span12'), $this->tc_breadcrumb_trail($this->args)));
 }
Ejemplo n.º 8
0
 /**
  * Main commments template
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_comments()
 {
     //By default not displayed on home, for protected posts, and if no comments for page option is checked
     $comments_bool = post_password_required() || tc__f('__is_home') || is_page() && 1 != esc_attr(tc__f('__get_option', 'tc_page_comments')) ? false : true;
     if (!apply_filters('tc_show_comments', $comments_bool)) {
         return;
     }
     comments_template('', true);
 }
 function tc_maybe_add_gfonts_to_editor()
 {
     $_font_pair = esc_attr(tc__f('__get_option', 'tc_fonts'));
     $_all_font_pairs = TC_init::$instance->font_pairs;
     if (false === strpos($_font_pair, '_g_')) {
         return;
     }
     //Commas in a URL need to be encoded before the string can be passed to add_editor_style.
     return array(str_replace(',', '%2C', sprintf('//fonts.googleapis.com/css?family=%s', TC_utils::$instance->tc_get_font('single', $_font_pair))));
 }
 /**
  * retrieve slider names and generate the select list
  * @package Customizr
  * @since Customizr 3.0.1
  */
 function tc_slider_choices()
 {
     $slider_names = tc__f('__get_option', 'tc_sliders');
     $slider_choices = array(0 => __('&mdash; No slider &mdash;', 'customizr'), 'demo' => __('&mdash; Demo Slider &mdash;', 'customizr'));
     if ($slider_names) {
         foreach ($slider_names as $tc_name => $slides) {
             $slider_choices[$tc_name] = $tc_name;
         }
     }
     return $slider_choices;
 }
        /**
         * The template displaying the front page featured page block.
         *
         *
         * @package Customizr
         * @since Customizr 3.0
         */
        function tc_fp_block_display()
        {
            //gets display options
            $tc_show_featured_pages = esc_attr(TC_utils::$inst->tc_opt('tc_show_featured_pages'));
            $tc_show_featured_pages_img = esc_attr(TC_utils::$inst->tc_opt('tc_show_featured_pages_img'));
            if (!apply_filters('tc_show_fp', 0 != $tc_show_featured_pages && tc__f('__is_home'))) {
                return;
            }
            //gets the featured pages array and sets the fp layout
            $fp_ids = apply_filters('tc_featured_pages_ids', TC_init::$instance->fp_ids);
            $fp_nb = count($fp_ids);
            $fp_per_row = apply_filters('tc_fp_per_line', 3);
            //defines the span class
            $span_array = array(1 => 12, 2 => 6, 3 => 4, 4 => 3, 5 => 2, 6 => 2, 7 => 2);
            $span_value = 4;
            $span_value = $fp_per_row > 7 ? 1 : $span_value;
            $span_value = isset($span_array[$fp_per_row]) ? $span_array[$fp_per_row] : $span_value;
            //save $args for filter
            $args = array($fp_ids, $fp_nb, $fp_per_row, $span_value);
            ?>

          <?php 
            ob_start();
            ?>

    			<div class="container marketing">

            <?php 
            do_action('__before_fp');
            $j = 1;
            for ($i = 1; $i <= $fp_nb; $i++) {
                printf('%1$s<div class="span%2$s fp-%3$s">%4$s</div>%5$s', 1 == $j ? sprintf('<div class="%1$s" role="complementary">', implode(" ", apply_filters('tc_fp_widget_area', array('row', 'widget-area')))) : '', $span_value, $fp_ids[$i - 1], $this->tc_fp_single_display($fp_ids[$i - 1], $tc_show_featured_pages_img), $j == $fp_per_row || $i == $fp_nb ? '</div>' : '');
                //set $j back to start value if reach $fp_per_row
                $j++;
                $j = $j == $fp_per_row + 1 ? 1 : $j;
            }
            do_action('__after_fp');
            ?>

    			</div><!-- .container -->

          <?php 
            echo !tc__f('__is_home_empty') ? apply_filters('tc_after_fp_separator', '<hr class="featurette-divider ' . current_filter() . '">') : '';
            ?>

         <?php 
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_fp_block_display', $html, $args);
        }
Ejemplo n.º 12
0
function my_credits_display($html)
{
    $logo_src = esc_url(tc__f('__get_option', 'tc_logo_upload'));
    if (empty($logo_src)) {
        return $html;
    }
    ?>

    <div class="span4 credits">

        <?php 
    $credits = sprintf('<br/><p> © <a href="%2$s">%3$s</a> %1$s <a href="mailto:%4$s" title="%2$s" >%4$s</a>   </p> ', esc_attr(date('Y')), esc_url(home_url()), esc_attr(get_bloginfo()), '*****@*****.**');
    echo $credits . "</div>";
}
Ejemplo n.º 13
0
    /**
     * The template part for displaying entry metas
     *
     * @package Customizr
     * @since Customizr 1.0
     */
    function tc_post_metas()
    {
        global $post;
        //when do we display the metas ?
        //1) we don't show metas on home page, 404, search page by default
        //2) +filter conditions
        $post_metas_bool = tc__f('__is_home') || is_404() || 'page' == $post->post_type ? false : true;
        $post_metas_bool = apply_filters('tc_show_post_metas', $post_metas_bool);
        if (!$post_metas_bool) {
            return;
        }
        ob_start();
        ?>

        <div class="entry-meta">
            <?php 
        if ('attachment' == $post->post_type) {
            $metadata = wp_get_attachment_metadata();
            printf('%1$s <span class="entry-date"><time class="entry-date updated" datetime="%2$s">%3$s</time></span> %4$s %5$s', '<span class="meta-prep meta-prep-entry-date">' . __('Published', 'customizr') . '</span>', esc_attr(get_the_date('c')), esc_html(get_the_date()), isset($metadata['width']) && isset($metadata['height']) ? __('at dimensions', 'customizr') . '<a href="' . esc_url(wp_get_attachment_url()) . '" title="' . __('Link to full-size image', 'customizr') . '"> ' . $metadata['width'] . ' &times; ' . $metadata['height'] . '</a>' : '', __('in', 'customizr') . '<a href="' . esc_url(get_permalink($post->post_parent)) . '" title="' . __('Return to ', 'customizr') . esc_attr(strip_tags(get_the_title($post->post_parent))) . '" rel="gallery"> ' . get_the_title($post->post_parent) . '</a>.');
        } else {
            $categories_list = $this->tc_category_list();
            $tag_list = $this->tc_tag_list();
            $date = apply_filters('tc_date_meta', sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s">%4$s</time></a>', esc_url(get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d'))), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())));
            //end filter
            $author = apply_filters('tc_author_meta', sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'customizr'), get_the_author())), get_the_author()));
            //end filter
            // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
            if ($tag_list) {
                $utility_text = __('This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
            } elseif ($categories_list) {
                $utility_text = __('This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
            } else {
                $utility_text = __('This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
            }
            $utility_text = apply_filters('tc_meta_utility_text', $utility_text);
            //echoes every metas components
            printf($utility_text, $categories_list, $tag_list, $date, $author);
        }
        //endif attachment
        ?>

        </div><!-- .entry-meta -->

        <?php 
        $html = ob_get_contents();
        if ($html) {
            ob_end_clean();
        }
        echo apply_filters('tc_post_metas', $html);
    }
Ejemplo n.º 14
0
 /**
  *
  * @package Customizr
  * @since Customizr 1.0
  */
 function tc_breadcrumb_display()
 {
     if (!apply_filters('tc_show_breadcrumb', 1 == esc_attr(TC_utils::$inst->tc_opt('tc_breadcrumb')))) {
         return;
     }
     if (!apply_filters('tc_show_breadcrumb_in_context', true)) {
         return;
     }
     if (tc__f('__is_home') && 1 != esc_attr(TC_utils::$inst->tc_opt('tc_show_breadcrumb_home'))) {
         return;
     }
     //set the args properties
     $this->args = $this->_get_args();
     echo apply_filters('tc_breadcrumb_display', sprintf('<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="%1$s">%2$s</div></div></div>', apply_filters('tc_breadcrumb_class', 'span12'), $this->tc_breadcrumb_trail($this->args)));
 }
      /**
      * @return void
      * set up hooks for archives headings
      * hook : template_redirect
      *
      * @package Customizr
      * @since Customizr 3.2.6
      */
      function tc_set_archives_heading_hooks() {
        //is there anything to render in the current context
        //by default don't display the Customizr title in feeds
        if ( apply_filters('tc_display_customizr_headings',  ! $this -> tc_archive_title_and_class_callback() || is_feed() ) )
          return;

        //Headings for archives, authors, search, 404
        add_action ( '__before_loop'                  , array( $this , 'tc_render_headings_view' ) );
        //Set archive icon with customizer options (since 3.2.0)
        add_filter ( 'tc_archive_icon'                , array( $this , 'tc_set_archive_icon' ) );

        add_filter( 'tc_archive_header_class'         , array( $this , 'tc_archive_title_and_class_callback'), 10, 2 );
        add_filter( 'tc_headings_archive_html'        , array( $this , 'tc_archive_title_and_class_callback'), 10, 1 );
        global $wp_query;
        if ( tc__f('__is_home') || $wp_query -> is_posts_page )
          add_filter( 'tc_archive_headings_separator' , '__return_false' );
      }
Ejemplo n.º 16
0
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     if ($item->is_dropdown && $depth === 0) {
         //makes top menu not clickable (default bootstrap behaviour)
         $search = '<a';
         $replace = 'hover' == esc_attr(tc__f('__get_option', 'tc_menu_type')) ? $search : '<a class="dropdown-toggle" data-toggle="dropdown" data-target="#"';
         $replace = apply_filters('menu_open_on_click', $replace, $search);
         $item_html = str_replace($search, $replace, $item_html);
         //adds arrows down
         $item_html = str_replace('</a>', ' <b class="caret"></b></a>', $item_html);
     } elseif (stristr($item_html, 'li class="divider')) {
         $item_html = preg_replace('/<a[^>]*>.*?<\\/a>/iU', '', $item_html);
     } elseif (stristr($item_html, 'li class="nav-header')) {
         $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '$1', $item_html);
     }
     $output .= $item_html;
 }
Ejemplo n.º 17
0
 /**
  * Menu Rendering
  *
  * @package Customizr
  * @since Customizr 3.0
  */
 function tc_menu_display($resp = null)
 {
     ob_start();
     //renders the responsive button
     if ('resp' == $resp) {
         //resp is an argument of do_action ('__navbar' , 'resp')
         $button = sprintf('<button type="button" class="%1$s" data-toggle="collapse" data-target=".nav-collapse">%2$s%2$s%2$s</button>', apply_filters('tc_menu_button_class', 'btn btn-navbar'), '<span class="icon-bar"></span>');
         echo apply_filters('resp_menu_button', $button);
     }
     //renders the menu
     $menu_args = apply_filters('tc_menu_args', array('theme_location' => 'main', 'menu_class' => 'hover' == esc_attr(tc__f('__get_option', 'tc_menu_type')) ? 'nav tc-hover-menu' : 'nav', 'fallback_cb' => array($this, 'tc_link_to_menu_editor'), 'walker' => TC_nav_walker::$instance, 'echo' => false));
     $menu_wrapper_class = 'hover' == esc_attr(tc__f('__get_option', 'tc_menu_type')) ? 'nav-collapse collapse tc-hover-menu-wrapper' : 'nav-collapse collapse';
     printf('<div class="%1$s">%2$s</div>', apply_filters('menu_wrapper_class', $menu_wrapper_class), wp_nav_menu($menu_args));
     $html = ob_get_contents();
     if ($html) {
         ob_end_clean();
     }
     echo apply_filters('tc_menu_display', $html, $resp);
 }
Ejemplo n.º 18
0
    /**
     * The template for displaying main customizr loop
     *
     *
     * @package Customizr
     * @since Customizr 3.0
     */
    function tc_loop()
    {
        //initialize the thumbnail class alternative index
        global $tc_i;
        $tc_i = 1;
        $tc_current_screen_layout = tc__f('__screen_layout', tc__f('__ID'));
        ?>

        <div class="<?php 
        echo $tc_current_screen_layout['class'];
        ?>
 article-container">

        <?php 
        /* get additionnal header for archive, search, 404 */
        do_action('__post_list_header');
        /* Start the Loop for all other case*/
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                do_action('__content');
                //if we display a page, check if comments are enabled in options. If it is a post, no conditions.
                if (is_page() && esc_attr(tc__f('__get_option', 'tc_page_comments') == 1) || is_single()) {
                    comments_template('', true);
                }
                $tc_i++;
            }
            //end while
        } else {
            //(is_404() || (is_search() && !have_posts()))
            do_action('__content');
        }
        /* include navigation for posts only */
        if (!is_page(tc__f('__ID'))) {
            do_action('__post_nav');
        }
        ?>

        </div><!--.article-container -->
        
      <?php 
    }
    /**
     * Returns the sidebar or the front page featured pages area
     * @param Name of the widgetized area
     * @package Customizr
     * @since Customizr 1.0 
     */
    function tc_get_sidebar($name)
    {
        //get layout options
        $id = tc__f('__ID');
        $tc_current_screen_layout = tc__f('__screen_layout', $id);
        $sidebar = $tc_current_screen_layout['sidebar'];
        $class = $tc_current_screen_layout['class'];
        //get info whether the front page is a list of last posts or a page
        $tc_what_on_front = get_option('show_on_front');
        switch ($name) {
            case 'left':
                if ($sidebar == 'l' || $sidebar == 'b') {
                    ?>
                <div class="span3 left tc-sidebar">

                  <?php 
                    get_sidebar($name);
                    ?>

                </div>
                <?php 
                }
                break;
            case 'right':
                if ($sidebar == 'r' || $sidebar == 'b') {
                    ?>
                <div class="span3 right tc-sidebar">

                  <?php 
                    get_sidebar($name);
                    ?>
                  
                </div>
                <?php 
                }
                break;
            case 'footer':
                get_sidebar($name);
                break;
        }
    }
Ejemplo n.º 20
0
        ?>

                                

                                <?php 
        the_post();
        ?>



                                <?php 
        do_action('__before_article');
        ?>

                                    <article <?php 
        tc__f('__article_selectors');
        ?>
>

                                        <?php 
        do_action('__loop');
        ?>

                                    </article>

                                <?php 
        do_action('__after_article');
        ?>


Ejemplo n.º 21
0
<?php

/**
 * The template for displaying the footer.
 *
 *
 * @package Customizr
 * @since Customizr 3.0
 */
do_action('__before_footer');
?>
		<!-- FOOTER -->
		<footer id="footer" class="<?php 
echo tc__f('tc_footer_classes', '');
?>
">
		 	<?php 
do_action('__footer');
// hook of footer widget and colophon
?>
		</footer>
		<?php 
wp_footer();
//do not remove, used by the theme and many plugins
do_action('__after_footer');
?>
	</body>
	<?php 
do_action('__after_body');
?>
</html>
Ejemplo n.º 22
0
 /**
  * Displays the social networks block in the header
  *
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_social_in_header($resp = null)
 {
     //class added if not resp
     $social_header_block_class = apply_filters('tc_social_header_block_class', 'span5', $resp);
     $social_header_block_class = 'resp' == $resp ? '' : $social_header_block_class;
     $html = sprintf('<div class="social-block %1$s">%2$s</div>', $social_header_block_class, 0 != tc__f('__get_option', 'tc_social_in_header') ? tc__f('__get_socials') : '');
     echo apply_filters('tc_social_in_header', $html, $resp);
 }
 /**
  * Callback of filter tc_thumb_size_name
  *
  *
  * @package Customizr
  * @since Customizr 3.2.0
  */
 function tc_set_thumb_size($_default_size)
 {
     $_shape = esc_attr(tc__f('__get_option', 'tc_post_list_thumb_shape'));
     if (!$_shape || false !== strpos($_shape, 'rounded') || false !== strpos($_shape, 'squared')) {
         return $_default_size;
     }
     $_position = esc_attr(tc__f('__get_option', 'tc_post_list_thumb_position'));
     return 'top' == $_position || 'bottom' == $_position ? 'tc_rectangular_size' : $_default_size;
 }
      function tc_pll_strings_setup() {

        // grab theme options
        $pll_tc_options = tc__f('__options');
        // grab settings map, useful for some options labels
        $tc_settings_map = TC_utils_settings_map::$instance -> tc_customizer_map( $get_default = true );
        $tc_controls_map = $tc_settings_map['add_setting_control'];
        // set $polylang_group;
        $polylang_group = 'customizr-pro' == TC___::$theme_name ? 'Customizr-Pro' : 'Customizr';

        // Add front page slider name to Polylang's string translation panel
        if ( isset( $pll_tc_options['tc_front_slider'] ) )
          pll_register_string( 'Front page slider name', esc_attr($pll_tc_options['tc_front_slider']), $polylang_group );
        // Add archive title strings to Polylang's string translation panel
        $archive_titles_settings =  array( 'tc_tag_title', 'tc_cat_title', 'tc_author_title', 'tc_search_title');
        foreach ( $archive_titles_settings as $archive_title_setting_name )
          if ( isset( $pll_tc_options[$archive_title_setting_name] ) )
            pll_register_string( $tc_controls_map["tc_theme_options[$archive_title_setting_name]"]["label"], esc_attr($pll_tc_options[$archive_title_setting_name]), $polylang_group );
        // Featured Pages
        if ( ! class_exists('TC_fpu') && ! class_exists('TC_fpc') ) {
          $pll_tc_fp_areas = TC_init::$instance -> fp_ids;
          // Add featured pages button text to Polylang's string translation panel
          if ( isset( $pll_tc_options[ 'tc_featured_page_button_text'] ) )
            pll_register_string( $tc_controls_map["tc_theme_options[tc_featured_page_button_text]"]["label"], esc_attr($pll_tc_options[ 'tc_featured_page_button_text']), $polylang_group );

          // Add featured pages excerpt text to Polylang's string translation panel
          foreach ( $pll_tc_fp_areas as $area )
            if ( isset( $pll_tc_options["tc_featured_text_$area"] ) )
              pll_register_string( $tc_controls_map["tc_theme_options[tc_featured_text_$area]"]["label"], esc_attr($pll_tc_options['tc_featured_text_'.$area]), $polylang_group );

        } //end Featured Pages
      }// end tc_pll_strings_setup function
        /**
         * Displays the slider based on the context : home, post/page.
         * 
         * @package Customizr
         * @since Customizr 1.0
         *
         */
        function tc_slider_display()
        {
            global $wp_query;
            //gets the front slider if any
            $tc_front_slider = tc__f('__get_option', 'tc_front_slider');
            //when do we display a slider? By default only for home (if a slider is defined), pages and posts (including custom post types)
            if (!apply_filters('tc_show_slider', !is_404() && !is_archive() && !is_search() || tc__f('__is_home') && $tc_front_slider)) {
                return;
            }
            //gets the actual page id if we are displaying the posts page
            $queried_id = get_queried_object_id();
            $queried_id = !tc__f('__is_home') && $wp_query->is_posts_page && !empty($queried_id) ? $queried_id : get_the_ID();
            //gets the current slider id
            $slider_name_id = tc__f('__is_home') && $tc_front_slider ? $tc_front_slider : esc_attr(get_post_meta($queried_id, $key = 'post_slider_key', $single = true));
            $slider_name_id = apply_filters('tc_slider_name_id', $slider_name_id, $queried_id);
            //is the slider set to on for the queried id?
            $slider_active = tc__f('__is_home') && $tc_front_slider ? true : esc_attr(get_post_meta($queried_id, $key = 'post_slider_check_key', $single = true));
            $slider_active = apply_filters('tc_slider_active_status', $slider_active, $queried_id);
            if (isset($slider_active) && !$slider_active) {
                return;
            }
            //gets slider options if any
            $layout_value = tc__f('__is_home') ? tc__f('__get_option', 'tc_slider_width') : esc_attr(get_post_meta($queried_id, $key = 'slider_layout_key', $single = true));
            $layout_value = apply_filters('tc_slider_layout', $layout_value, $queried_id);
            //declares the layout vars
            $layout_class = implode(" ", apply_filters('tc_slider_layout_class', 0 == $layout_value ? array('container', 'carousel', 'slide') : array('carousel', 'slide')));
            $img_size = apply_filters('tc_slider_img_size', 0 == $layout_value ? 'slider' : 'slider-full');
            //get slides
            $slides = $this->tc_get_slides($slider_name_id, $img_size);
            //returns nothing if no slides to display
            if (!$slides) {
                return;
            }
            ob_start();
            ?>
      <div id="customizr-slider" class="<?php 
            echo $layout_class;
            ?>
 ">
          <?php 
            if ('demo' == $slider_name_id || 1 == esc_attr(tc__f('__get_option', 'tc_display_slide_loader')) && apply_filters('tc_display_slider_loader', true)) {
                ?>
            <div class="tc-slider-loader-wrapper">
              <div class="tc-img-gif-loader">
                <img src="<?php 
                echo apply_filters('tc_slider_loader_src', sprintf('%1$s/%2$s', TC_BASE_URL, 'inc/assets/img/slider-loader.gif'));
                ?>
">
              </div>
            </div>
          <?php 
            }
            ?>
          <div class="carousel-inner">
            <?php 
            foreach ($slides as $id => $data) {
                ?>
              <?php 
                $slide_class = sprintf('%1$s %2$s', $data['active'], 'slide-' . $id);
                ?>
              <div class="item <?php 
                echo $slide_class;
                ?>
">

                <div class="<?php 
                echo apply_filters('tc_slide_content_class', sprintf('carousel-image %1$s', $img_size));
                ?>
">
                  <?php 
                do_action('__before_all_slides');
                do_action_ref_array("__before_slide_{$id}", array($data['slide_background'], $data['link_url'], $id, $slider_name_id));
                echo apply_filters('tc_slide_background', $data['slide_background'], $data['link_url'], $id, $slider_name_id);
                do_action_ref_array("__after_slide_{$id}", array($data['slide_background'], $data['link_url'], $id, $slider_name_id));
                do_action('__after_all_slides');
                ?>
                </div> <!-- .carousel-image -->
                <?php 
                if ($data['title'] != null || $data['text'] != null || $data['button_text'] != null) {
                    //apply filters first
                    $data['title'] = isset($data['title']) ? apply_filters('tc_slide_title', $data['title'], $id, $slider_name_id) : '';
                    $data['text'] = isset($data['text']) ? esc_html(apply_filters('tc_slide_text', $data['text'], $id, $slider_name_id)) : '';
                    $data['color_style'] = apply_filters('tc_slide_color', $data['color_style'], $id, $slider_name_id);
                    $data['link_id'] = apply_filters('tc_slide_link_id', $data['link_id'], $id, $slider_name_id);
                    $data['link_url'] = 'demo' == $slider_name_id && is_null($data['link_url']) ? admin_url() . 'customize.php' : $data['link_url'];
                    $data['link_url'] = apply_filters('tc_slide_link_url', $data['link_url'], $id, $slider_name_id);
                    $data['button_text'] = isset($data['button_text']) ? apply_filters('tc_slide_button_text', $data['button_text'], $id, $slider_name_id) : '';
                    //computes the link
                    $button_link = !is_user_logged_in() && 'demo' == $slider_name_id ? 'javascript:void(0)' : $data['link_url'];
                    $button_link = $data['link_id'] != null && $data['link_url'] != null ? $data['link_url'] : $button_link;
                    printf('<div class="carousel-caption">%1$s %2$s %3$s</div>', $data['title'] != null ? sprintf('<%1$s %2$s>%3$s</%1$s>', apply_filters('tc_slide_title_tag', 'h1', $slider_name_id), $data['color_style'], $data['title']) : '', $data['text'] != null ? sprintf('<p class="lead" %1$s>%2$s</p>', $data['color_style'], $data['text']) : '', $data['button_text'] != null ? sprintf('<a class="%1$s" href="%2$s">%3$s</a>', apply_filters('tc_slide_button_class', 'btn btn-large btn-primary', $slider_name_id), $button_link, $data['button_text']) : '');
                }
                //end if there content to show in caption
                //display edit link for logged in users with edit posts capabilities
                $show_edit_link = is_user_logged_in() && current_user_can('upload_files') ? true : false;
                $show_edit_link = apply_filters('tc_show_slider_edit_link', $show_edit_link && !is_null($data['link_id']));
                if ($show_edit_link) {
                    printf('<span class="slider edit-link btn btn-inverse"><a class="post-edit-link" href="%1$s" title="%2$s" target="_blank">%2$s</a></span>', get_edit_post_link($id) . '#slider_sectionid', __('Edit', 'customizr'));
                }
                //end edit attachment condition
                ?>

              </div><!-- /.item -->

            <?php 
            }
            ?>

          </div><!-- /.carousel-inner -->

          <?php 
            do_action('__after_carousel_inner', $slides);
            ?>

        </div><!-- /#customizr-slider -->
              
        <?php 
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_slider_display', $html, $slider_name_id);
        }
 /**
  * Displays the social networks block in the footer
  *
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_colophon_left_block()
 {
     //when do we display this block ?
     //1) if customizing always. (is hidden if empty of disabled)
     //2) if not customizing : must be enabled and have social networks.
     $_nothing_to_render = 0 == esc_attr(TC_utils::$inst->tc_opt('tc_social_in_footer')) || !tc__f('__get_socials');
     $_hide_socials = $_nothing_to_render && TC___::$instance->tc_is_customizing();
     $_nothing_to_render = $_nothing_to_render && !TC___::$instance->tc_is_customizing();
     echo apply_filters('tc_colophon_left_block', sprintf('<div class="%1$s">%2$s</div>', apply_filters('tc_colophon_left_block_class', 'span4 social-block pull-left'), !$_nothing_to_render ? sprintf('<span class="tc-footer-social-links-wrapper" %1$s>%2$s</span>', $_hide_socials ? 'style="display:none"' : '', tc__f('__get_socials')) : ''));
 }
 /**
  * The template part for displaying entry metas
  *
  * @package Customizr
  * @since Customizr 1.0
  */
 function tc_content_post_metas()
 {
     $categories_list = tc__f('__category_list');
     $tag_list = tc__f('__tag_list');
     $date = sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
     $author = sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'customizr'), get_the_author())), get_the_author());
     // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
     if ($tag_list) {
         $utility_text = __('This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
     } elseif ($categories_list) {
         $utility_text = __('This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
     } else {
         $utility_text = __('This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
     }
     printf($utility_text, $categories_list, $tag_list, $date, $author);
 }
 /**
  *
  * @return string or bool
  *
  */
 function tc_get_context()
 {
     if (is_page()) {
         return 'page';
     }
     if (is_single() && !is_attachment()) {
         return 'single';
     }
     // exclude attachments
     if (!is_404() && !tc__f('__is_home_empty')) {
         return 'archive';
     }
     return false;
 }
Ejemplo n.º 29
0
 /**
  * Gets the social networks list defined in customizer options
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_get_social_networks()
 {
     $__options = tc__f('__options');
     //gets the social network array
     $socials = apply_filters('tc_default_socials', TC_init::$instance->socials);
     //declares some vars
     $html = '';
     foreach ($socials as $key => $data) {
         if ($__options[$key] != '') {
             //gets height and width from image, we check if getimagesize can be used first with the error control operator
             $width = $height = '';
             if (isset($data['custom_icon_url']) && @getimagesize($data['custom_icon_url'])) {
                 list($width, $height) = getimagesize($data['custom_icon_url']);
             }
             //there is one exception : rss feed has no target _blank and special icon title
             $html .= sprintf('<a class="%1$s" href="%2$s" title="%3$s" %4$s %5$s>%6$s</a>', apply_filters('tc_social_link_class', sprintf('social-icon icon-%1$s', $key == 'tc_rss' ? 'feed' : str_replace('tc_', '', $key)), $key), esc_url($__options[$key]), isset($data['link_title']) ? call_user_func('__', $data['link_title'], 'customizr') : '', $key == 'tc_rss' ? '' : apply_filters('tc_socials_target', 'target=_blank', $key), apply_filters('tc_additional_social_attributes', '', $key), isset($data['custom_icon_url']) && !empty($data['custom_icon_url']) ? sprintf('<img src="%1$s" width="%2$s" height="%3$s" alt="%4$s"/>', $data['custom_icon_url'], $width, $height, isset($data['link_title']) ? call_user_func('__', $data['link_title'], 'customizr') : '') : '');
         }
     }
     return $html;
 }
 /**
  * Callback for tc_logo_class
  *
  * @package Customizr
  * @since Customizr 3.2.0
  */
 function tc_set_logo_title_layout($_classes)
 {
     //backward compatibility (was not handled has an array in previous versions)
     if (!is_array($_classes)) {
         return $_classes;
     }
     $_layout = esc_attr(tc__f('__get_option', 'tc_header_layout'));
     switch ($_layout) {
         case 'left':
             $_classes = array('brand', 'span3', 'pull-left');
             break;
         case 'right':
             $_classes = array('brand', 'span3', 'pull-right');
             break;
         default:
             $_classes = array('brand', 'span3', 'pull-left');
             break;
     }
     return $_classes;
 }