Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $bg_url= '';
- $cats = get_terms('category');
- foreach($cats as $cat) {
- $term_id = $cat->term_id;
- }
- $bg_img = rwmb_meta( 'myprefix_cat_banner_image', array( 'object_type' => 'term' ), $term_id );
- if(count($bg_img) > '0') {
- foreach ($bg_img as $img){
- $bg = "{$img['full_url']}";
- $bg_url = "background-image: url('". $bg ."');";
- }
- $bg_pos = "background-position: " . rwmb_meta('myprefix_cat_banner_bgpos') . ";";
- $banner_text = rwmb_meta('myprefix_cat_banner_text', array( 'object_type' => 'term'), $term_id);
- }?>
- <!-- ==== HEADERWRAP ==== -->
- <div class="pagewrap row">
- <div class="pagewrapcolor col-md-5 col-lg-5 col-sm-12" style="background-color:<?php echo rwmb_meta('myprefix_cat_bg-color', array( 'object_type' => 'term' ), $term_id);?>;">
- <?php if ($banner_text != '') {
- echo $banner_text;
- } else {
- echo '<h1 id="site-description">'.get_bloginfo( 'description', 'display' ) .'</h1>';
- }?>
- </div>
- <div class="pagewrapimg col-md-7 col-lg-7 col-sm-12" style="<?php echo $bg_url.$bg_pos;?>">
Add Comment
Please, Sign In to add comment