/**
 * display  slider  on home page
 */
function corpo_featured_image_slider()
{
    ob_start();
    $array_image = (array) get_corpo_option('slide_img');
    $slide_meta_off = get_corpo_option('slide_meta_off');
    $array_title = (array) get_corpo_option('slide_head');
    $array_text = (array) get_corpo_option('slide_desc');
    $array_btn = (array) get_corpo_option('slide_btn');
    $array_link = (array) get_corpo_option('slide_url');
    ?>
    <section id="featured-slider" class="slider-cycle">
        <div class="slider-rotate">
            <?php 
    //we support 5 slides
    for ($i = 0; $i <= 4; $i++) {
        $slider_image = $array_image[$i];
        //image path
        $slider_title = $array_title[$i];
        $slider_text = $array_text[$i];
        $slider_btn = $array_btn[$i];
        $slider_link = $array_link[$i];
        //don't show if img ath is not set
        if (!empty($slider_image) && $slider_image !== '') {
            ?>
                    <div class="slides" <?php 
            if ($i != 0) {
                echo ' style="display:none;" ';
            }
            ?>
>
                        <img alt="<?php 
            echo esc_attr($slider_title);
            ?>
" src="<?php 
            echo esc_url($slider_image);
            ?>
">
                        <?php 
            if (!$slide_meta_off) {
                ?>
                            <div class="slider-meta-wrap">
                                <div class="slider-meta">
                                    <?php 
                if (!empty($slider_title)) {
                    ?>
                                        <h1 class="slider-title animated fadeInLeftBig"><?php 
                    echo esc_html($slider_title);
                    ?>
</h1>
                                    <?php 
                }
                ?>
                                    <?php 
                if (!empty($slider_text)) {
                    ?>
                                        <h3 class="slider-description animated zoomIn"><?php 
                    echo esc_html($slider_text);
                    ?>
</h3>
                                    <?php 
                }
                ?>
                                    <?php 
                if (!empty($slider_link)) {
                    ?>
                                        <div class="slider-button">
                                            <a href="<?php 
                    echo esc_url($slider_link);
                    ?>
"><?php 
                    echo esc_html($slider_btn);
                    ?>
</a>
                                        </div>
                                    <?php 
                }
                ?>
                                </div>
                                <!--slider meta -->
                            </div>
                        <?php 
            }
            ?>
                    </div><!--end slide-->
                <?php 
        }
        //end if image not empty
        ?>
            <?php 
    }
    //end for loop
    ?>
        </div>
        <!--slider rotate-->
        <div class="slider-nav">
            <a class="slide-next" href="#"><i class="fa fa-angle-right"></i></a>
            <a class="slide-prev" href="#"><i class="fa fa-angle-left"></i></a>
        </div>
    </section> <!--slider cycle-->
    <?php 
    //just strip white space
    echo preg_replace('/(\\s)+/s', '\\1', ob_get_clean());
}
Exemplo n.º 2
0
flush();
//speed tweak
?>
</head>
<body <?php 
body_class();
?>
>
<div id="page" class="hfeed site">
    <a class="skip-link screen-reader-text" href="#content">Skip to content</a>
    <header id="masthead" class="site-header" role="banner">
        <div class="inner-wrap clearfix">
            <div class="site-branding">
                <?php 
$head_logo = get_corpo_option('logo_image', '');
$head_choice = get_corpo_option('logo_opt', 2);
//1-logo only,2=headings only,3=both
if (($head_choice == 1 || $head_choice == 3) && $head_logo !== '') {
    ?>
                    <a href="<?php 
    echo esc_url(home_url('/'));
    ?>
" title="<?php 
    echo esc_attr(get_bloginfo('name', 'display'));
    ?>
" rel="home"><img class="site-logo" src="<?php 
    echo esc_url($head_logo);
    ?>
" alt="<?php 
    echo esc_attr(get_bloginfo('name', 'display'));
    ?>