Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $output = '';
- $sub_img = array();
- global $post;
- if(!function_exists('thmtheme_call_sub_header')){
- function thmtheme_call_sub_header(){
- global $themeum_options;
- if(isset($themeum_options['blog-banner']['url'])){
- $output = 'style="background-image:url('.esc_url($themeum_options['blog-banner']['url']).');background-size: cover;background-position: 50% 50%;padding: 65px 0;"';
- return $output;
- }else{
- $output = 'style="background-color:'.esc_attr($themeum_options['blog-subtitle-bg-color']).';padding: 65px 0;"';
- return $output;
- }
- }
- }
- if( isset($post->post_name) ){
- if(!empty($post->ID)){
- $image_attached = esc_attr(get_post_meta( $post->ID , 'thm_subtitle_images', true ));
- if(!empty($image_attached)){
- $sub_img = wp_get_attachment_image_src( $image_attached , 'blog-full');
- $output = 'style="background-image:url('.esc_url($sub_img[0]).');background-size: cover;background-position: 50% 50%;padding: 65px 0;"';
- if(empty($sub_img[0])){
- $output = 'style="background-color:'.esc_attr(rwmb_meta("thm_subtitle_color")).';padding: 65px 0;"';
- if(rwmb_meta("thm_subtitle_color") == ''){
- $output = thmtheme_call_sub_header();
- }
- }
- }else{
- if(rwmb_meta("thm_subtitle_color") != "" ){
- $output = 'style="background-color:'.esc_attr(rwmb_meta("thm_subtitle_color")).';padding: 65px 0;"';
- }else{
- $output = thmtheme_call_sub_header();
- }
- }
- }else{
- $output = thmtheme_call_sub_header();
- }
- }else{
- $output = thmtheme_call_sub_header();
- }
- ?>
- <?php if (!is_front_page()) { ?>
- <div class="sub-title" <?php echo $output;?>>
- <div class="container">
- <div class="sub-title-inner">
- <div class="row">
- <div class="col-sm-12">
- <?php
- global $wp_query;
- if(isset($wp_query->queried_object->name)){
- if($wp_query->queried_object->name != ''){
- if($wp_query->queried_object->name == 'product' ){
- echo '<h2>'.esc_html__('Shop','zephyr').'</h2>';
- }else{
- echo '<h2 class="page-leading">'.$wp_query->queried_object->name.'</h2>';
- }
- }else{
- echo '<h2 class="page-leading">'.get_the_title().'</h2>';
- }
- }elseif(get_post_type() == 'page') {
- echo '<h2 class="page-leading">'.get_the_title().'</h2>';
- }elseif (is_single()) {
- if(get_post_type() == 'product'){
- echo '<h2>'.esc_html__('Product Details','zephyr').'</h2>';
- }else {
- echo '<h2>'.esc_html__('Single Post','zephyr').'</h2>';
- }
- }
- ?>
- <?php themeum_breadcrumbs(); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement