🚀 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-test
/
wp-content
/
themes
/
fujibow
✏️
Editing: single.php
<?php $cats = get_the_category(); //現在のカテゴリー情報取得 $cat_name = $cats[0]->name; //親カテゴリー名取得 $cat_slug = $cats[0]->slug; //親カテゴリースラッグ取得 $cat_id = $cats[0]->term_id; //親カテゴリーID取得 $category_link = get_category_link($cat_id); ?> <?php get_header(); ?> <main id="single" class="single <?php foreach ($cats as $cat) { echo $cat->slug . ' '; } ?>"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php // ヘッダー,コンテンツ読み込み $page_header_args = [ 'slug' => 'News', 'title' => 'お知らせ', 'image' => IMG_PATH . '/common/page-header-works.svg', ]; $header_type = 'header'; // ページヘッダーレイアウト get_template_part('template-parts/page', $header_type, $page_header_args); ?> <div class="single__contents"> <section class="single-news"> <div class="single-news__inner inner"> <time class="single-news__date" datetime="<?php the_time('c'); ?>"><?php the_time('Y/m/d'); ?></time> <h2 class="single-news__title"><?php the_title(); ?></h2> <div class="single-news__content"><?php the_content(); ?></div> <div class="single-news__btn"> <a class="btn" href="<?php echo esc_url(home_url()); ?>/category/news/"><span>お知らせ 一覧に戻る</span></a> </div> </div> </section> </div> <?php endwhile; ?> <?php else : ?> <?php endif; ?> </main><!-- .site-main --> <?php get_footer(); ?>
💾 Save Changes
❌ Cancel