/** * Header data for header section * * @return array */ public static function header_data() { $header_image = get_header_image(); $page_layout_class = ' .page-layout-' . Model_Page_Layout_Settings::get_layout() . ' .page-layout-width-' . Model_Page_Layout_Settings::get_width() . ' .page-layout-sidebar-width-' . Model_Page_Layout_Settings::get_sidebar_width(); $header = array('allowedtags' => $GLOBALS['allowedtags'], 'language_attributes' => get_language_attributes(), 'body_class' => implode(' ', get_body_class()) . $page_layout_class, 'charset' => get_bloginfo('charset'), 'ping_back_url' => get_bloginfo('pingback_url'), 'name' => get_bloginfo('name'), 'home_url' => esc_url(home_url('/')), 'description' => get_bloginfo('description'), 'favicon' => General_Site_Settings_Model::get_favicon(), 'touch_icon' => General_Site_Settings_Model::get_touch_icon(), 'custom_styles' => '', 'is_enabled_preloader' => Model_Logo_And_Favicon::is_enable_page_preloader(), 'logo' => General_Site_Settings_Model::get_logo(), 'socials' => View::make('blocks/socials', array('socials' => Social_Settings_Model::get_all_socials(), 'where' => 'header')), 'socials_show_header' => Social_Settings_Model::is_show_header(), 'disclimer' => Header_Settings_Model::get_disclimer(), 'search_box' => Header_Settings_Model::get_search_box(), 'header_style_layout' => Header_Settings_Model::get_header_style(), 'header_layout_view' => sprintf('header-%s', Header_Settings_Model::get_header_style()), 'header_image' => $header_image, 'header_slogan' => get_option('photolab_header_slogan'), 'header_class' => Header_Settings_Model::get_header_class(), 'static_class' => empty($header_image) ? 'static' : 'absolute', 'term_description' => term_description(), 'welcome_message' => get_option('photolab'), 'main_menu' => wp_nav_menu(array('theme_location' => 'main', 'container' => 'nav', 'container_class' => 'main-navigation', 'container_id' => 'site-navigation', 'menu_class' => 'sf-menu', 'walker' => new Photolab_Walker(), 'echo' => false)), 'top_menu' => wp_nav_menu(array('theme_location' => 'top', 'container' => 'nav', 'container_class' => 'top-navigation', 'container_id' => 'site-navigation', 'menu_class' => 'sf-top-menu', 'walker' => new Photolab_Walker(), 'echo' => false))); $header['alt_mess'] = Utils::array_get($header['welcome_message'], 'welcome_title', get_bloginfo('name')); return $header; }
/** * Get header css classes * * @return string css classes */ public static function get_header_class() { $classes = array('page-header', 'header-type-' . rand(1, 8)); if (!Header_Settings_Model::is_show_title_on_header()) { array_push($classes, 'invisibility'); } if (has_post_thumbnail() or get_header_image()) { array_push($classes, 'with-img'); } return implode(' ', $classes); }
<?php /** * Load all assets * * @package photolab */ /** * Enqueue comment reply */ function conf_enqueue_comment_reply() { if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } return array('scripts' => array(array('photolab-navigation', Utils::assets_url() . 'js/navigation.js', array(), '20120206', true), array('photolab-skip-link-focus-fix', Utils::assets_url() . 'js/skip-link-focus-fix.js', array(), '20130115', true), array('photolab-superfish', Utils::assets_url() . 'js/jquery.superfish.min.js', array('jquery'), '1.4.9', true), array('photolab-mobilemenu', Utils::assets_url() . 'js/jquery.mobilemenu.js', array('jquery'), '1.0', true), array('photolab-sfmenutouch', Utils::assets_url() . 'js/jquery.sfmenutouch.js', array('jquery'), '1.0', true), array('photolab-magnific-popup', Utils::assets_url() . 'js/jquery.magnific-popup.min.js', array('jquery'), '1.0.0', true), array('photolab-device', Utils::assets_url() . 'js/device.min.js', array('jquery'), '1.0.2', true), array('photolab-sticky', Utils::assets_url() . 'js/jquery.stickyheader.js', array('jquery'), '1.0', true), array('photolab-custom', Utils::assets_url() . 'js/custom.js', array('jquery'), '1.0', true), array('masonry', 'https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.2/masonry.pkgd.min.js', array('jquery'))), 'styles' => array(array('photolab-layout', Utils::assets_url() . 'css/layout.css', array(), '1.1.0'), array('photolab-magnific-popup', Utils::assets_url() . 'css/magnific-popup.css', array(), '1.1.0'), array('dashicons'), array('photolab-fonts', Main_Model::fonts_url(), array(), null), array('photolab-style', get_stylesheet_uri(), array(), '1.1.0'), array('photolab-font-awesome', Utils::assets_url() . 'css/font-awesome-4.5.0/css/font-awesome.min.css', array()), array('photolab-layout-ie', Utils::assets_url() . 'css/layout-ie.css', array(), '1.1.0')), 'localize' => array(array('photolab-custom', 'photolab_custom', array('stickup_menu' => Header_Settings_Model::get_stickup_menu())), array('photolab-layout-ie', 'conditional', 'lte IE 8')), 'custom' => array('conf_enqueue_comment_reply'));
/** * Start the element output. * * @see Walker::start_el() * * @since 3.0.0 * * @param type $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu(). * @param int $id Current item ID. */ public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { $indent = $depth ? str_repeat("\t", $depth) : ''; $classes = empty($item->classes) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; /** * Filter the CSS class(es) applied to a menu item's list item element. * * @since 3.0.0 * @since 4.1.0 The `$depth` parameter was added. * * @param array $classes The CSS classes that are applied to the menu item's `<li>` element. * @param object $item The current menu item. * @param array $args An array of {@see wp_nav_menu()} arguments. * @param int $depth Depth of menu item. Used for padding. */ $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth)); $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; /** * Filter the ID applied to a menu item's list item element. * * @since 3.0.1 * @since 4.1.0 The `$depth` parameter was added. * * @param type $menu_id The ID that is applied to the menu item's `<li>` element. * @param object $item The current menu item. * @param array $args An array of {@see wp_nav_menu()} arguments. * @param int $depth Depth of menu item. Used for padding. */ $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth); $id = $id ? ' id="' . esc_attr($id) . '"' : ''; $output .= $indent . '<li' . $id . $class_names . '>'; $atts = array(); $atts['title'] = !empty($item->attr_title) ? $item->attr_title : ''; $atts['target'] = !empty($item->target) ? $item->target : ''; $atts['rel'] = !empty($item->xfn) ? $item->xfn : ''; $atts['href'] = !empty($item->url) ? $item->url : ''; /** * Filter the HTML attributes applied to a menu item's anchor element. * * @since 3.6.0 * @since 4.1.0 The `$depth` parameter was added. * * @param array $atts { * The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored. * * @type string $title Title attribute. * @type string $target Target attribute. * @type string $rel The rel attribute. * @type string $href The href attribute. * } * @param object $item The current menu item. * @param array $args An array of {@see wp_nav_menu()} arguments. * @param int $depth Depth of menu item. Used for padding. */ $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth); $attributes = ''; foreach ($atts as $attr => $value) { if (!empty($value)) { $value = 'href' === $attr ? esc_url($value) : esc_attr($value); $attributes .= ' ' . $attr . '="' . $value . '"'; } } $item_output = ''; if (is_object($args)) { $item_output = $args->before; $item_output .= '<a' . $attributes . '>'; /** This filter is documented in wp-includes/post-template.php */ $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $item_output .= '</a>'; if (0 == $depth) { if (Header_Settings_Model::get_title_attributes()) { $item_output .= sprintf('<span class="title-attributes">%s</span>', $item->post_excerpt); } } $item_output .= $args->after; } /** * Filter a menu item's starting output. * * The menu item's starting output only includes `$args->before`, the opening `<a>`, * the menu item's title, the closing `</a>`, and `$args->after`. Currently, there is * no filter for modifying the opening and closing `<li>` for a menu item. * * @since 3.0.0 * * @param type $item_output The menu item's starting HTML output. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of {@see wp_nav_menu()} arguments. */ $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); }