Example #1
0
 /**
  * Returns the parallax header with its features.
  *
  * @since 1.0.0
  */
 function zen_parallax_header()
 {
     $prefix = 'zen_';
     // Background image to insert in the parallax style
     $bg_image = rwmb_meta("{$prefix}parallax_image", array('type' => 'image_advanced', 'size' => 'parallax_header_bg'));
     $bg_image = array_shift($bg_image);
     // The color of the tile & breadcrumbs
     // TODO: Insert the color on the parallax somehow, when you do the breadcrumbs
     $txt_color = rwmb_meta("{$prefix}parallax_color", array('type' => 'color'));
     if ($txt_color == 'dark') {
         $style = 'style="background: url(' . $bg_image['full_url'] . ') fixed center center; -webkit-background-size: cover; background-size: cover; color: #333333;"';
         $output = '<div class="source-page source-bg-01" ' . $style . '>';
         $output .= '<div class="container"><h1>';
         $output .= get_the_title();
         $output .= '</h1>';
         $output .= zen_breadcrumbs();
         $output .= '</div></div>';
     } else {
         $style = 'style="background: url(' . $bg_image['full_url'] . ') fixed center center; -webkit-background-size: cover; background-size: cover;"';
         $output = '<div class="source-page source-bg-01" ' . $style . '>';
         $output .= '<div class="container"><h1>';
         $output .= get_the_title();
         $output .= '</h1>';
         $output .= zen_breadcrumbs('bullet-arrow-white');
         $output .= '</div></div>';
     }
     echo $output;
 }
?>

<?php 
get_header();
?>

<!-- Page title -->
<div class="source-page fadeInDown">
    <div class="container">
        <h1>
            <?php 
single_cat_title();
?>
        </h1>
        <?php 
echo zen_breadcrumbs();
?>
    </div>
</div>

<div class="container container-m-tb-small">

    <?php 
$cat = single_cat_title('', false);
$cat = get_term_by('name', $cat, 'zen_port_cat');
$shortcode = '[zen_portfolio type="1" category="' . $cat->term_id . '"]';
echo do_shortcode($shortcode);
?>

</div>