🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home
/
users
/
2
/
fujibow
/
web
/
fujibow.co.jp
/
wp
/
wp-content
/
themes
/
wp-theme
✏️
Editing: header.php
<?php global $assets; global $cat_root_id; global $cat_root_slug; global $cat_root_title; $navs = array( 'information'=>array('title'=>'最新情報','class'=>''), 'service'=>array( 'title'=>'富士防の取り組み', 'class'=>'', 'sub' => array( ['title'=>'富士防のSDGsの取り組み','link'=>'/service/sustainability2/','image'=>'/service/service04.jpg'], ['title'=>'富士防クオリティ','link'=>'/service/quality/','image'=>'/service/service01.jpg'], ['title'=>'大規模修繕','link'=>'/service/repair/','image'=>'/service/service02.jpg'], ['title'=>'防水工事','link'=>'/service/repair/waterproof/','image'=>'/service/service03.jpg'] ) ), 'works'=>array('title'=>'実績','class'=>''), 'faq'=>array('title'=>'よくあるご質問','class'=>''), 'recruit'=>array( 'title'=>'採用情報', 'class'=>'', 'sub' => array( ['title'=>'人で知る富士防','link'=>'/company/interview/','image'=>'/recruit/recruit01.jpg'], ['title'=>'仕事で知る富士防','link'=>'/recruit/work/','image'=>'/recruit/recruit02.jpg'], ['title'=>'新卒採用','link'=>'/recruit/newgraduates/','image'=>'/recruit/recruit03.jpg'], ['title'=>'中途採用','link'=>'/recruit/career/','image'=>'/recruit/recruit04.jpg'] ) ), 'company'=>array( 'title'=>'会社概要', 'class'=>'', 'sub' => array( ['title'=>'代表ご挨拶','link'=>'/company/message/','image'=>'/company/company01.jpg'], ['title'=>'会社概要・沿革','link'=>'/company/outline/','image'=>'/company/company02.jpg'], ['title'=>'経営理念','link'=>'/company/vision/','image'=>'/company/company03.jpg'], // ['title'=>'キャラクター','link'=>'/company/character/','image'=>'/company/company05.jpg'], ['title'=>'人で知る富士防','link'=>'/company/interview/','image'=>'/company/company05.jpg'], // ['title'=>'仕事で知る富士防','link'=>'/company/work/','image'=>'/company/company06.jpg'] ) ), ); function catnavs($atts) { if(is_page()){ $page = get_page(get_the_ID()); $_slug = $page->post_name; } extract(shortcode_atts(array( 'name' => 'service' ), $atts)); $subs = []; if($name == 'recruit') { $args = array( 'post_type' => 'page', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_name__in' => ['interview'] ); $added = new WP_Query($args); if($added->have_posts()) { while ($added->have_posts()){ $added->the_post(); $item = []; $_id = get_the_ID(); $item['title'] = get_the_title(); $item['link'] = get_permalink(); $slug = get_post_field('post_name', $_id); $item['class'] = ""; if($slug == $_slug) { $item['class'] = ' on'; } $subs[] = $item; } wp_reset_postdata(); } } $list = get_page_by_path($name); $args = array( 'post_type' => 'page', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_parent' => $list->ID ); $lists = new WP_Query($args); if($lists->have_posts()) { while ($lists->have_posts()){ $lists->the_post(); $item = []; $_id = get_the_ID(); $item['title'] = get_the_title(); $item['link'] = get_permalink(); $slug = get_post_field('post_name', $_id); $item['class'] = ""; if($slug == $_slug) { $item['class'] = ' on'; } $subs[] = $item; $args['post_parent'] = $_id; if($name != 'company') { $sub = new WP_Query($args); if($sub->have_posts()) { while ($sub->have_posts()){ $sub->the_post(); $item = []; $_id = get_the_ID(); $item['title'] = get_the_title(); $item['link'] = get_permalink(); $slug = get_post_field('post_name', $_id); $item['class'] = ""; if($slug == $_slug) { $item['class'] = ' on'; } $subs[] = $item; } wp_reset_postdata(); } } } wp_reset_postdata(); } $html = '<ul class="list-anchor list-anchor2">'; foreach($subs as $item){ $html .= "<li><a href='{$item['link']}' class='btn{$item['class']}'>{$item['title']}</a></li>"; } $html .= '</ul>'; return $html; } add_shortcode('catnav', 'catnavs'); if(is_page()){ $page = get_page(get_the_ID()); $cat_root_id = get_the_ID(); $cat_root_slug = $page->post_name; $cat_root_title = $page->post_title; $parent = get_page_parent( $page->post_parent , false ); if($parent) { $cat_root_id = $parent; $cat_root_slug = get_page($parent)->post_name; $cat_root_title = get_page($parent)->post_title; } if($cat_root_slug == 'service'){ $cat_root_title = 'サービス'; } if(isset($navs[$cat_root_slug])){ $navs[$cat_root_slug]['class'] = 'on'; } } if(is_category()){ $category = get_category( $cat ); $slug = $category->slug; if(isset($navs[$slug])){ $navs[$slug]['class'] = 'on'; } $navs[$cat_root_slug]['class'] = 'on'; } if(is_single()){ $categories = get_the_category(); if(isset($categories) && count($categories) > 0) { $cat_slug = $categories[0]->slug; if($cat_slug == 'works') { $navs['works']['class'] = ' on'; } } } ?> <!doctype html> <!--[if IE 8]><html lang="ja" class="no-js lt-ie9"><![endif]--> <!--[if gt IE 8]><!--><html lang="ja" class="no-js"><!--<![endif]--> <head> <meta name="google-site-verification" content="qMaTqHdsnlTUQ_2vZIQ2ZuN0i_irPZT8wwNYZpxgcc8" /> <meta name="google-site-verification" content="wzNt8IN4ZyQTrOUL9eaDCNigU7ntp20uQsWKaVFZwKQ" /> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> <?php if(is_home()): ?> <?php bloginfo('name'); ?> <?php else: ?> <?php wp_title(''); ?> | <?php bloginfo('name'); ?> <?php endif; ?> </title> <link rel="icon" href="<?php echo get_template_directory_uri(); ?>/favicon.ico"> <link rel="apple-touch-icon" href="<?php echo get_template_directory_uri(); ?>/apple-touch-icon.png"> <link rel="stylesheet" href="<?php echo $assets; ?>/css/common.css"> <link rel="stylesheet" href="<?php echo $assets; ?>/css/style.css"> <link rel="stylesheet" href="/assets/css/style-add.css"> <script src="<?php echo $assets; ?>/js/libs/modernizr.js"></script> <?php wp_head(); ?> </head> <body<?php if(is_home()): ?> id="home"<?php endif;?>> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = 'https://connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v3.1&appId=716601288690002&autoLogAppEvents=1'; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <header id="header"> <div class="wrap"> <?php if(is_home()): ?> <h1 class="logo"><img src="<?php echo $assets; ?>/images/common/logo.png" alt=""><img src="<?php echo $assets; ?>/images/common/logo2.png" alt="株式会社 富士防"></h1> <?php else:?> <div class="logo"><a href="/"><img src="<?php echo $assets; ?>/images/common/logo.png" alt=""><img src="<?php echo $assets; ?>/images/common/logo2.png" alt="株式会社 富士防"></a></div> <?php endif;?> <nav id="nav"> <ul> <?php foreach($navs as $k=>$v):?> <li<?php if(isset($v['sub'])):?> class="has-sub"<?php endif;?>> <a href="/<?php echo $k;?>/" class="<?php echo $v['class'];?>"><?php echo $v['title'];?></a> <?php if(isset($v['sub'])):?> <span class="sp sub-btn"><i class="fal fa-chevron-down"></i></span> <div class="local"> <ul> <?php foreach($v['sub'] as $sub):?> <li> <a href="<?php echo $sub['link'];?>"> <figure class="pc"><img src="/assets/images<?php echo $sub['image'];?>"></figure> <span><i class="fas fa-chevron-circle-right sp"></i><?php echo $sub['title'];?><i class="fal fa-arrow-right pc"></i></span> </a> </li> <?php endforeach;?> </ul> </div> <?php endif;?> </li> <?php endforeach;?> </ul> </nav> <a href="tel:0120327223" class="tel btn"><i class="fal fa-phone"></i><span class="pc font">0120-<span>327-223</span></span></a> <a href="/inquiry/" class="btn"><i class="fal fa-envelope"></i><span class="pc">お問い合わせ</span></a> <a class="nav-trigger" href=""> <span></span> <span></span> <span></span> </a> </div> </header> <div id="nav-cover"></div> <?php /*wp_nav_menu(array( 'theme_location' => 'header-nav', 'items_wrap' => '<ul>%3$s</ul>', 'container' => false, 'class_menu' => '' ));*/ ?>
💾 Save Changes
❌ Cancel