function hu_get_widget_zone_allowed_contexts($id, $_user_option = null) { $_user_option = is_null($_user_option) ? hu_get_option('sidebar-areas') : $_user_option; $allowed_contexts = array(); $no_option_found = true; foreach ($_user_option as $key => $_zone) { if ($id != $_zone['id'] || !empty($allowed_contexts)) { continue; } if (array_key_exists('contexts', $_zone)) { $allowed_contexts = is_array($_zone['contexts']) ? $_zone['contexts'] : array(); $no_option_found = false; } } return $no_option_found ? 'no_option_found' : $allowed_contexts; }
echo $_footer_logo_img_src; ?> " alt="<?php get_bloginfo('name'); ?> "> <?php } ?> <div id="copyright"> <?php if (hu_get_option('copyright')) { ?> <p><?php echo esc_attr(hu_get_option('copyright')); ?> </p> <?php } else { ?> <p><?php bloginfo(); ?> © <?php echo date('Y'); ?> . <?php _e('All Rights Reserved.', 'hueman'); ?> </p>
</div><!--/.post-meta--> <h2 class="post-title entry-title"> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a> </h2><!--/.post-title--> <?php if (hu_get_option('excerpt-length') != '0') { ?> <div class="entry excerpt entry-summary"> <?php the_excerpt(); ?> </div><!--/.entry--> <?php } ?> </div><!--/.post-content--> </div><!--/.post-inner--> </article><!--/.post-->
echo $_footer_logo_img_src; ?> " alt="<?php get_bloginfo('name'); ?> "> <?php } ?> <div id="copyright"> <?php if (hu_get_option('copyright')) { ?> <p><?php echo wp_kses_post(hu_get_option('copyright')); ?> </p> <?php } else { ?> <p><?php bloginfo(); ?> © <?php echo date('Y'); ?> . <?php _e('All Rights Reserved.', 'hueman'); ?> </p>
?> <div class="pad group"> <?php if (hu_is_checked('featured-posts-enabled')) { get_template_part('parts/featured'); } ?> <?php if (have_posts()) { ?> <?php if (hu_get_option('blog-standard') == 'on') { ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content-standard'); ?> <?php } ?> <?php } else { ?> <div class="post-list group">
?> <div class="sidebar-top group"> <p><?php echo hu_has_social_links() ? __('Follow:', 'hueman') : ' '; ?> </p> <?php hu_print_social_links(); ?> </div> <?php } ?> <?php if (hu_get_option('post-nav') == 's1') { get_template_part('parts/post-nav'); } ?> <?php if (is_page_template('page-templates/child-menu.php')) { ?> <ul class="child-menu group"> <?php wp_list_pages('title_li=&sort_column=menu_order&depth=3'); ?> </ul> <?php } ?>
/** * hook : admin_notices */ function hu_may_be_display_update_notice() { $opt_name = 'last_update_notice'; $last_update_notice_values = hu_get_option($opt_name); $show_new_notice = false; if (!$last_update_notice_values || !is_array($last_update_notice_values)) { //first time user of the theme, the option does not exist // 1) initialize it => set it to the current Hueman version, displayed 0 times. // 2) update in db $last_update_notice_values = array("version" => HUEMAN_VER, "display_count" => 0); HU_utils::$inst->hu_set_option($opt_name, $last_update_notice_values); //already user of the theme ? if (hu_user_started_before_version(HUEMAN_VER)) { $show_new_notice = true; } } $_db_version = $last_update_notice_values["version"]; $_db_displayed_count = $last_update_notice_values["display_count"]; //user who just upgraded the theme will be notified until he/she clicks on the dismiss link //or until the notice has been displayed 5 times. if (version_compare(HUEMAN_VER, $_db_version, '>')) { //CASE 1 : displayed less than 5 times if ($_db_displayed_count < 5) { $show_new_notice = true; //increments the counter (int) $_db_displayed_count++; $last_update_notice_values["display_count"] = $_db_displayed_count; //updates the option val with the new count HU_utils::$inst->hu_set_option($opt_name, $last_update_notice_values); } else { //reset option value with new version and counter to 0 $new_val = array("version" => HUEMAN_VER, "display_count" => 0); HU_utils::$inst->hu_set_option($opt_name, $new_val); } //end else } //end if if (!$show_new_notice) { return; } ob_start(); ?> <div class="updated" style="position:relative"> <?php echo apply_filters('hu_update_notice', sprintf('<h3>%1$s %2$s %3$s %4$s :D</h3>', __("Good, you've just upgraded to", "hueman"), 'Hueman', __("version", "hueman"), HUEMAN_VER)); ?> <?php echo apply_filters('hu_update_notice', sprintf('<h4>%1$s</h4><strong><a class="button button-primary" href="%2$s" title="%3$s" target="_blank">%3$s »</a> <a class="button button-primary" href="%4$s" title="%5$s" target="_blank">%5$s »</a></strong>', __("We'd like to introduce the new features we've been working on.", "hueman"), HU_WEBSITE . "/category/hueman-releases/", __("Read the latest release notes", "hueman"), esc_url('demo-hueman.presscustomizr.com'), __("Visit the demo", "hueman"))); ?> <p style="text-align:right;position: absolute;right: 7px;bottom: -5px;"> <?php printf('<em>%1$s <strong><a href="#" title="%1$s" class="tc-dismiss-update-notice"> ( %2$s x ) </a></strong></em>', __("I already know what's new thanks !", "hueman"), __('close', 'hueman')); ?> </p> </div> <?php $_html = ob_get_contents(); if ($_html) { ob_end_clean(); } echo $_html; }
function hu_dynamic_css() { if (!hu_is_checked('dynamic-styles')) { return; } // rgb values $color_1 = hu_get_option('color-1'); $color_1_rgb = hu_hex2rgb($color_1); // start output $styles = '<style type="text/css">' . "\n"; $styles .= '/* Dynamic CSS: For no styles in head, copy and put the css below in your child theme\'s style.css, disable dynamic styles */' . "\n"; // google fonts if (hu_get_option('font') == 'titillium-web-ext') { $styles .= 'body { font-family: "Titillium Web", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'droid-serif') { $styles .= 'body { font-family: "Droid Serif", serif; }' . "\n"; } if (hu_get_option('font') == 'source-sans-pro') { $styles .= 'body { font-family: "Source Sans Pro", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'lato') { $styles .= 'body { font-family: "Lato", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'raleway') { $styles .= 'body { font-family: "Raleway", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'ubuntu' || hu_get_option('font') == 'ubuntu-cyr') { $styles .= 'body { font-family: "Ubuntu", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'roboto-condensed' || hu_get_option('font') == 'roboto-condensed-cyr') { $styles .= 'body { font-family: "Roboto Condensed", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'roboto-slab' || hu_get_option('font') == 'roboto-slab-cyr') { $styles .= 'body { font-family: "Roboto Slab", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'playfair-display' || hu_get_option('font') == 'playfair-display-cyr') { $styles .= 'body { font-family: "Playfair Display", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'open-sans' || hu_get_option('font') == 'open-sans-cyr') { $styles .= 'body { font-family: "Open Sans", Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'pt-serif' || hu_get_option('font') == 'pt-serif-cyr') { $styles .= 'body { font-family: "PT Serif", serif; }' . "\n"; } if (hu_get_option('font') == 'arial') { $styles .= 'body { font-family: Arial, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'georgia') { $styles .= 'body { font-family: Georgia, serif; }' . "\n"; } if (hu_get_option('font') == 'verdana') { $styles .= 'body { font-family: Verdana, sans-serif; }' . "\n"; } if (hu_get_option('font') == 'tahoma') { $styles .= 'body { font-family: Tahoma, sans-serif; }' . "\n"; } // container width if (hu_get_option('container-width') != '1380') { if (hu_is_checked('boxed')) { $styles .= '.boxed #wrapper, .container-inner { max-width: ' . hu_get_option('container-width') . 'px; }' . "\n"; } else { $styles .= '.container-inner { max-width: ' . hu_get_option('container-width') . 'px; }' . "\n"; } } // sidebar padding if (hu_get_option('sidebar-padding') != '30') { $styles .= '.sidebar .widget { padding-left: ' . hu_get_option('sidebar-padding') . 'px; padding-right: ' . hu_get_option('sidebar-padding') . 'px; padding-top: ' . hu_get_option('sidebar-padding') . 'px; }' . "\n"; } // primary color if (hu_get_option('color-1') != '#3b8dbd') { $styles .= ' ::selection { background-color: ' . hu_get_option('color-1') . '; } ::-moz-selection { background-color: ' . hu_get_option('color-1') . '; } a, .themeform label .required, #flexslider-featured .flex-direction-nav .flex-next:hover, #flexslider-featured .flex-direction-nav .flex-prev:hover, .post-hover:hover .post-title a, .post-title a:hover, .s1 .post-nav li a:hover i, .content .post-nav li a:hover i, .post-related a:hover, .s1 .widget_rss ul li a, #footer .widget_rss ul li a, .s1 .widget_calendar a, #footer .widget_calendar a, .s1 .alx-tab .tab-item-category a, .s1 .alx-posts .post-item-category a, .s1 .alx-tab li:hover .tab-item-title a, .s1 .alx-tab li:hover .tab-item-comment a, .s1 .alx-posts li:hover .post-item-title a, #footer .alx-tab .tab-item-category a, #footer .alx-posts .post-item-category a, #footer .alx-tab li:hover .tab-item-title a, #footer .alx-tab li:hover .tab-item-comment a, #footer .alx-posts li:hover .post-item-title a, .comment-tabs li.active a, .comment-awaiting-moderation, .child-menu a:hover, .child-menu .current_page_item > a, .wp-pagenavi a { color: ' . hu_get_option('color-1') . '; } .themeform input[type="submit"], .themeform button[type="submit"], .s1 .sidebar-top, .s1 .sidebar-toggle, #flexslider-featured .flex-control-nav li a.flex-active, .post-tags a:hover, .s1 .widget_calendar caption, #footer .widget_calendar caption, .author-bio .bio-avatar:after, .commentlist li.bypostauthor > .comment-body:after, .commentlist li.comment-author-admin > .comment-body:after { background-color: ' . hu_get_option('color-1') . '; } .post-format .format-container { border-color: ' . hu_get_option('color-1') . '; } .s1 .alx-tabs-nav li.active a, #footer .alx-tabs-nav li.active a, .comment-tabs li.active a, .wp-pagenavi a:hover, .wp-pagenavi a:active, .wp-pagenavi span.current { border-bottom-color: ' . hu_get_option('color-1') . '!important; } ' . "\n"; } // secondary color if (hu_get_option('color-2') != '#82b965') { $styles .= ' .s2 .post-nav li a:hover i, .s2 .widget_rss ul li a, .s2 .widget_calendar a, .s2 .alx-tab .tab-item-category a, .s2 .alx-posts .post-item-category a, .s2 .alx-tab li:hover .tab-item-title a, .s2 .alx-tab li:hover .tab-item-comment a, .s2 .alx-posts li:hover .post-item-title a { color: ' . hu_get_option('color-2') . '; } .s2 .sidebar-top, .s2 .sidebar-toggle, .post-comments, .jp-play-bar, .jp-volume-bar-value, .s2 .widget_calendar caption { background-color: ' . hu_get_option('color-2') . '; } .s2 .alx-tabs-nav li.active a { border-bottom-color: ' . hu_get_option('color-2') . '; } .post-comments span:before { border-right-color: ' . hu_get_option('color-2') . '; } ' . "\n"; } // topbar color if (hu_get_option('color-topbar') != '#26272b') { $styles .= ' .search-expand, #nav-topbar.nav-container { background-color: ' . hu_get_option('color-topbar') . '; } @media only screen and (min-width: 720px) { #nav-topbar .nav ul { background-color: ' . hu_get_option('color-topbar') . '; } } ' . "\n"; } // header color if (hu_get_option('color-header') != '#33363b') { $styles .= ' #header { background-color: ' . hu_get_option('color-header') . '; } @media only screen and (min-width: 720px) { #nav-header .nav ul { background-color: ' . hu_get_option('color-header') . '; } } ' . "\n"; } // header menu color if (hu_get_option('color-header-menu') != '') { $styles .= ' #nav-header.nav-container { background-color: ' . hu_get_option('color-header-menu') . '; } @media only screen and (min-width: 720px) { #nav-header .nav ul { background-color: ' . hu_get_option('color-header-menu') . '; } } ' . "\n"; } // footer color if (hu_get_option('color-footer') != '#33363b') { $styles .= '#footer-bottom { background-color: ' . hu_get_option('color-footer') . '; }' . "\n"; } // header logo max-height if (hu_get_option('logo-max-height') != '60') { $styles .= '.site-title a img { max-height: ' . hu_get_option('logo-max-height') . 'px; }' . "\n"; } // image border radius if (hu_get_option('image-border-radius') != '0') { $styles .= 'img { -webkit-border-radius: ' . hu_get_option('image-border-radius') . 'px; border-radius: ' . hu_get_option('image-border-radius') . 'px; }' . "\n"; } // // body background (old) // if ( hu_get_option('body-background') != '#eaeaea' ) { // $styles .= 'body { background-color: '.hu_get_option('body-background').'; }'."\n"; // } // body background (@fromfull) => keep on wp.org $body_bg = hu_get_option('body-background'); if (!empty($body_bg)) { //for users of wp.org version prior to 3.0+, this option is an hex color string. if (is_string($body_bg)) { $styles .= 'body { background-color: ' . $body_bg . '; }' . "\n"; } elseif (is_array($body_bg) && isset($body_bg['background-color'])) { $styles .= 'body { background-color: ' . $body_bg['background-color'] . '; }' . "\n"; } // elseif ( is_array($body_bg) ) { // $body_bg = wp_parse_args( // $body_bg, // array( // 'background-color' => "#eaeaea", // 'background-image' => false, // 'background-position' => '', // 'background-attachment' => '', // 'background-repeat' => '', // 'backgrount-size' => '' // ) // ); // $body_color = $body_bg['background-color']; // $body_image = $body_bg['background-image']; // $body_position = $body_bg['background-position']; // $body_attachment = $body_bg['background-attachment']; // $body_repeat = $body_bg['background-repeat']; // $body_size = $body_bg['background-size']; // if ( false !== $body_image && $body_size == "" ) { // $styles .= 'body { background: '.$body_color.' url('.$body_image.') '.$body_attachment.' '.$body_position.' '.$body_repeat.'; }'."\n"; // } elseif ( false !== $body_image && $body_size != "" ) { // $styles .= 'body { background: '.$body_color.' url('.$body_image.') '.$body_attachment.' '.$body_position.' '.$body_repeat.'; background-size: '.$body_size.'; }'."\n"; // } elseif ( '' != $body_color ) { // $styles .= 'body { background-color: '.$body_color.'; }'."\n"; // } else { // $styles .= ''; // } // } } $styles .= '</style>' . "\n"; // end output echo $styles; }
/** * Замена функции из оригинального шаблона * Нужна для добавления Noto Sans */ function hu_google_fonts() { if (!hu_is_checked('dynamic-styles')) { return; } if (hu_get_option('font') == 'titillium-web-ext') { echo '<link href="//fonts.googleapis.com/css?family=Titillium+Web:400,400italic,300italic,300,600&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'droid-serif') { echo '<link href="//fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'source-sans-pro') { echo '<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,300italic,300,400italic,600&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'lato') { echo '<link href="//fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'raleway') { echo '<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'noto') { echo '<link href="=//fonts.googleapis.com/css?family=Noto+Sans:700,400&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'noto-cyr') { echo '<link href="//fonts.googleapis.com/css?family=Noto+Sans:700,400&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'ubuntu') { echo '<link href="//fonts.googleapis.com/css?family=Ubuntu:400,400italic,300italic,300,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'ubuntu-cyr') { echo '<link href="//fonts.googleapis.com/css?family=Ubuntu:400,400italic,300italic,300,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'roboto-condensed') { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'roboto-condensed-cyr') { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'roboto-slab') { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Slab:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'roboto-slab-cyr') { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Slab:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'playfair-display') { echo '<link href="//fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'playfair-display-cyr') { echo '<link href="//fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700&subset=latin,cyrillic" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'open-sans') { echo '<link href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,600&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'open-sans-cyr') { echo '<link href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,600&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'pt-serif') { echo '<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">' . "\n"; } if (hu_get_option('font') == 'pt-serif-cyr') { echo '<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">' . "\n"; } }
?> <?php if ('content' == hu_get_option('post-nav')) { get_template_part('parts/post-nav'); } ?> <?php if (hu_is_checked('subpost-ads')) { get_template_part('inc/post-ads'); } ?> <?php if ('1' != hu_get_option('related-posts')) { get_template_part('parts/related-posts'); } ?> <?php if (hu_is_checked('post-comments')) { comments_template('/comments.php', true); } ?> </div><!--/.pad--> </section><!--/.content--> <?php
useCSS: false, // Fix iPad flickering issue directionNav: true, controlNav: true, pauseOnHover: true, animationSpeed: 400, smoothHeight: true, touch: <?php echo apply_filters('hu_flexslider_touch_support', true); ?> , slideshow: <?php echo hu_is_checked('featured-slideshow') ? 'true' : 'false'; ?> , slideshowSpeed: <?php echo hu_get_option('featured-slideshow-speed', 5000); ?> , }); } }, 20); }); </script> <div class="featured flexslider" id="flexslider-featured"> <ul class="slides"> <?php while ($featured->have_posts()) { $featured->the_post(); ?>
function hu_maybe_register_custom_widget_zones() { $customized = array(); if (hu_is_customizing() && isset($_POST['customized'])) { $customized = json_decode(wp_unslash($_POST['customized']), true); if (isset($customized['hu_theme_options[sidebar-areas]'])) { $sidebars = $customized['hu_theme_options[sidebar-areas]']; } else { $sidebars = hu_get_option('sidebar-areas', array()); } } else { $sidebars = hu_get_option('sidebar-areas', array()); } //at this point we need smthg really clean if (!is_array($sidebars) || empty($sidebars)) { return; } $default_args = array('name' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'); $default_zones = hu_get_default_widget_zones(); foreach ($sidebars as $sb) { if (!isset($sb['id']) || empty($sb['id'])) { return; } //is it a built-in one? //=> in this case it's been registered another way $_id = $sb['id']; if (isset($default_zones[$_id])) { continue; } $args = wp_parse_args(array('name' => isset($sb['title']) ? '' . esc_attr($sb['title']) . '' : '', 'id' => '' . esc_attr(strtolower($sb['id'])) . ''), $default_args); register_sidebar($args); } //for each }