Example #1
0
<?php

global $post;
$idz_pid = indonez_get_postid();
$id = isset($post->ID) ? $idz_pid : "";
$theID = $id;
$prefix = "_indonez_";
$idz_sidebars = get_post_meta($theID, $prefix . "page_sidebar_widget", true);
if (!empty($idz_sidebars)) {
    dynamic_sidebar($idz_sidebars);
} else {
    if (is_active_sidebar('indonez-blog-sidebar')) {
        dynamic_sidebar('indonez-blog-sidebar');
    }
}
 function indonez_get_header_section()
 {
     global $idz_opt, $post;
     $idz_pid = indonez_get_postid();
     $id = isset($post->ID) ? $idz_pid : "";
     $theID = $id;
     $header_topmenu_opt = isset($idz_opt['header_topmenu_opt']) ? esc_attr($idz_opt['header_topmenu_opt']) : 1;
     $header_social_opt = isset($idz_opt['header_social_opt']) ? esc_attr($idz_opt['header_social_opt']) : 1;
     $header_contact_opt = isset($idz_opt['header_contact_opt']) ? esc_attr($idz_opt['header_contact_opt']) : 1;
     $header_searchbox_opt = isset($idz_opt['header_searchbox_opt']) ? esc_attr($idz_opt['header_searchbox_opt']) : 1;
     $header_style = isset($idz_opt['header_style']) ? $idz_opt['header_style'] : 'default';
     $header_style_blog = isset($idz_opt['header_style_blog']) ? $idz_opt['header_style_blog'] : 'default';
     $prefix = '_indonez_';
     $page_header_style = get_post_meta($theID, $prefix . 'page_header_style', true);
     if ($header_style != "none") {
         if ($header_style == "default") {
             $header_class = "";
         } else {
             if ($header_style == "style2") {
                 $header_class = 'class="header-version2"';
             } else {
                 if ($header_style == "style3") {
                     $header_class = 'class="header-version3"';
                 }
             }
         }
         $header_style_opt = $header_style;
     } else {
         if ($page_header_style != "") {
             if ($page_header_style == "default") {
                 $header_class = "";
             } else {
                 if ($page_header_style == "style2") {
                     $header_class = 'class="header-version2"';
                 } else {
                     if ($page_header_style == "style3") {
                         $header_class = 'class="header-version3"';
                     }
                 }
             }
             $header_style_opt = $page_header_style;
         } else {
             if ($header_style_blog != "") {
                 if ($header_style_blog == "default") {
                     $header_class = "";
                 } else {
                     if ($header_style_blog == "style2") {
                         $header_class = 'class="header-version2"';
                     } else {
                         if ($header_style_blog == "style3") {
                             $header_class = 'class="header-version3"';
                         }
                     }
                 }
                 $header_style_opt = $header_style_blog;
             }
         }
     }
     $output = '<!-- header information  -->';
     $output .= '<header id="idz-header" ' . $header_class . '>';
     if ($header_style_opt == "default") {
         if ($header_topmenu_opt == 1 || $header_social_opt == 1) {
             $output .= '<div class="header-info-container">';
             $output .= '<div class="row">';
             $output .= '<div class="large-12 column">';
             $output .= '<div class="header-info-left">';
             if ($header_topmenu_opt == 1) {
                 $output .= indonez_get_top_nav();
             }
             $output .= '</div>';
             if ($header_social_opt == 1) {
                 $output .= indonez_get_header_social_link("right", "color");
             }
             if (function_exists('indonez_wpml_shortcode_lang')) {
                 $output .= '<div class="language-flag">';
                 $output .= indonez_wpml_shortcode_lang();
                 $output .= '</div>';
             }
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
         }
         $output .= '<!-- header infomration end here -->';
         $output .= '<div class="row">';
         $output .= '<div class="large-12 column">';
         $output .= indonez_get_main_logo();
         if ($header_contact_opt == 1) {
             $output .= indonez_get_header_contact("");
         }
         $output .= '</div>';
         $output .= '</div>';
         $output .= '<div class="navigation-container">';
         $output .= '<div class="row">';
         $output .= '<div class="large-12 column">';
         $output .= indonez_get_main_nav();
         if ($header_searchbox_opt == 1) {
             $output .= indonez_get_header_searchbox("");
         }
         $output .= '</div>';
         $output .= '</div>';
         $output .= '</div>';
     } else {
         if ($header_style_opt == "style2") {
             $output .= '<div class="row">';
             $output .= '<div class="large-12 column">';
             $output .= indonez_get_main_logo();
             $output .= '<!-- menu navigation -->';
             $output .= '<div class="navigation-container">';
             if (function_exists('indonez_wpml_shortcode_lang')) {
                 $output .= '<div class="language-flag">';
                 $output .= indonez_wpml_shortcode_lang();
                 $output .= '</div>';
             }
             if ($header_searchbox_opt == 1) {
                 $output .= indonez_get_header_searchbox("inline");
             }
             $output .= indonez_get_main_nav();
             $output .= '<!-- menu navigation end here -->';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
         } else {
             if ($header_style_opt == "style3") {
                 if ($header_social_opt == 1 || $header_contact_opt == 1) {
                     $output .= '<!-- header information  -->';
                     $output .= '<div class="header-info-container">';
                     $output .= '<div class="row">';
                     $output .= '<div class="large-12 column">';
                     if ($header_social_opt == 1) {
                         $output .= indonez_get_header_social_link("left", "bgcolor");
                     }
                     if ($header_contact_opt == 1) {
                         $output .= indonez_get_header_contact("inline");
                     }
                     if (function_exists('indonez_wpml_shortcode_lang')) {
                         $output .= '<div class="language-flag">';
                         $output .= indonez_wpml_shortcode_lang();
                         $output .= '</div>';
                     }
                     $output .= '</div>';
                     $output .= '</div>';
                     $output .= '</div>';
                     $output .= '<!-- header infomration end here -->';
                 }
                 $output .= '<div class="row">';
                 $output .= '<div class="large-12 column">';
                 $output .= indonez_get_main_logo();
                 $output .= '<!-- menu navigation -->';
                 $output .= '<div class="navigation-container">';
                 if ($header_searchbox_opt == 1) {
                     $output .= indonez_get_header_searchbox("inline");
                 }
                 $output .= indonez_get_main_nav();
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
         }
     }
     $output .= '</header>';
     echo $output;
 }