<div class="page-tip"> <?php echo status_tip('info', ___('Please set some widgets in footer.')); ?> </div> </div> </div> </div> <?php } ?> </div> <!-- links --> <?php if (theme_cache::is_home()) { ?> <div class="widget panel links-container"> <div class="heading"> <h2 class="widget-title"> <i class="fa fa-link"></i> <?php echo ___('Links'); ?> </h2> </div> <div class="content"> <?php /** * links */ theme_cache::wp_nav_menu(['theme_location' => 'links-footer', 'container' => 'nav', 'menu_class' => 'menu', 'menu_id' => 'links-footer', 'fallback_cb' => 'custom_navwalker::fallback', 'walker' => new custom_navwalker()]);
/** * get_crumb * * * @return string The html code * @version 2.0.7 * */ public static function get_crumb(array $args = []) { $args = array_merge(['header' => null, 'footer' => null], $args); $links = []; if (theme_cache::is_home()) { return null; } $links['home'] = '<a href="' . theme_cache::home_url() . '" class="home" title="' . ___('Back to Homepage') . '"> <i class="fa fa-home fa-fw"></i> <span class="tx">' . ___('Back to Homepage') . '</span> </a>'; $split = '<span class="split"><i class="fa fa-angle-right"></i></span>'; /* category */ if (theme_cache::is_category()) { $cat_curr = theme_features::get_current_cat_id(); if ($cat_curr > 1) { $links_cat = get_category_parents($cat_curr, true, '%split%'); $links_cats = explode('%split%', $links_cat); array_pop($links_cats); $links['category'] = implode($split, $links_cats); $links['curr_text'] = ___('Category Browser'); } /* tag */ } else { if (theme_cache::is_tag()) { $tag_id = theme_features::get_current_tag_id(); $tag_obj = get_tag($tag_id); $links['tag'] = '<a href="' . esc_url(get_tag_link($tag_id)) . '">' . esc_html(theme_features::get_current_tag_name()) . '</a>'; $links['curr_text'] = ___('Tags Browser'); /* date */ } else { if (theme_cache::is_date()) { global $wp_query; $day = $wp_query->query_vars['day']; $month = $wp_query->query_vars['monthnum']; $year = $wp_query->query_vars['year']; /* day */ if (theme_cache::is_day()) { $date_link = get_day_link(null, null, $day); /* month */ } else { if (theme_cache::is_month()) { $date_link = get_month_link($year, $month); /* year */ } else { if (theme_cache::is_year()) { $date_link = get_year_link($year); } } } $links['date'] = '<a href="' . $date_link . '">' . theme_cache::wp_title('', false) . '</a>'; $links['curr_text'] = ___('Date Browser'); /* search*/ } else { if (theme_cache::is_search()) { // $nav_link = null; $links['curr_text'] = sprintf(___('Search Result: %s'), esc_html(get_search_query())); /* author */ } else { if (theme_cache::is_author()) { global $author; $user = get_user_by('id', $author); $links['author'] = '<a href="' . theme_cache::get_author_posts_url($author) . '">' . theme_cache::get_the_author_meta('display_name', $user->ID) . '</a>'; $links['curr_text'] = ___('Author posts'); /* archive */ } else { if (theme_cache::is_archive()) { $links['archive'] = '<a href="' . get_current_url() . '">' . theme_cache::wp_title('', false) . '</a>'; $links['curr_text'] = ___('Archive Browser'); /* Singular */ } else { if (theme_cache::is_singular()) { global $post; /* The page parent */ if ($post->post_parent) { $links['singular'] = '<a href="' . theme_cache::get_permalink($post->post_parent) . '">' . theme_cache::get_the_title($post->post_parent) . '</a>'; } /** * post / page */ if (theme_features::get_current_cat_id() > 1) { $categories = get_the_category($post->ID); foreach ($categories as $key => $row) { $parent_id[$key] = $row->category_parent; } array_multisort($parent_id, SORT_ASC, $categories); foreach ($categories as $cat) { $cat_name = esc_html($cat->name); $links['singular'] = '<a href="' . esc_url(get_category_link($cat->cat_ID)) . '" title="' . sprintf(___('View all posts in %s'), $cat_name) . '">' . $cat_name . '</a>'; } } //$links['curr_text'] = esc_html(theme_cache::get_the_title($post->ID)); /* 404 */ } else { if (theme_cache::is_404()) { // $nav_link = null; $links['curr_text'] = ___('Not found'); } } } } } } } } return '<div class="crumb-container"> ' . $args['header'] . ' <nav class="crumb"> ' . implode($split, apply_filters('crumb_links', $links)) . ' </nav> ' . $args['footer'] . ' </div>'; }
</div><!-- /.tools --> <!-- search form --> <form id="fm-search" action="<?php echo theme_cache::home_url(); ?> /" data-focus-target="#fm-search-s"> <input id="fm-search-s" name="s" class="form-control" placeholder="<?php echo ___('Please input search keyword'); ?> " value="<?php echo esc_attr(get_search_query()); ?> " type="search" required> </form> </div><!-- /.g --> </div><!-- /.nav-main --> <div class="nav-main-placeholder"></div> <?php /** * ad */ if (!theme_cache::is_home() && class_exists('theme_adbox') && !empty(theme_adbox::display_frontend('below-header-menu'))) { ?> <div class="g"><div class="ad-container ad-below-header-menu"><?php echo theme_adbox::display_frontend('below-header-menu'); ?> </div></div> <?php }
public static function frontend_js_config(array $config) { if (wp_is_mobile() || !theme_cache::is_home()) { return $config; } $config[__CLASS__] = ['type' => self::get_type()]; return $config; }
<div id="sidebar-container" class="g-desktop-1-4"> <div id="sidebar" class="widget-area" role="complementary"> <?php /** * home widget */ if (theme_cache::is_home() && !theme_cache::dynamic_sidebar('widget-area-home')) { ?> <div class="panel"> <div class="content"> <div class="page-tip"> <?php echo status_tip('info', ___('Please set some widgets in homepage.')); ?> </div> </div> </div> <?php /** * archive widget */ } else { if ((theme_cache::is_category() || theme_cache::is_archive() || theme_cache::is_search()) && !theme_cache::dynamic_sidebar('widget-area-archive')) { ?> <div class="panel"> <div class="content"> <div class="page-tip"> <?php echo status_tip('info', ___('Please set some widgets in archive.')); ?> </div>
/** * get_site_keywords * * @return string * @example * @version 1.0.1 * @copyright Copyright (c) 2011-2013 INN STUDIO. (http://www.inn-studio.com) **/ public static function get_site_keywords() { $all_tags = []; /** * post page */ if (theme_cache::is_singular('post')) { $posttags = get_the_tags(); if (!empty($posttags)) { foreach ($posttags as $v) { $all_tags[] = $v->name; } } /** * other page */ } else { if (!theme_cache::is_home()) { $single_term_title = single_term_title('', false); $all_tags[] = apply_filters('meta_keywords_not_home', $single_term_title); /** * load keywords */ } else { if (self::get_options('keywords')) { $theme_kws = explode(self::$keywords_split, self::get_options('keywords')); if (!empty($theme_kws)) { foreach ($theme_kws as $v) { if (!empty($v)) { $all_tags[] = trim($v); } } } } } } /** * add a hook */ $all_tags = array_filter(apply_filters('meta_keywords', $all_tags)); if (!empty($all_tags)) { echo '<meta name="keywords" content="' . esc_attr(strip_tags(implode(',', $all_tags))) . '">'; } }