-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-sfwd-topic.php
111 lines (94 loc) · 3.95 KB
/
single-sfwd-topic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package kanso-general
*/
get_header(); ?>
<div uk-grid class="uk-grid-match uk-flex-center uk-grid-divider">
<div class="uk-width-xxlarge">
<div class="uk-container uk-container-auto uk-background-default main-content-lib">
<?php
while ( have_posts() ) :
the_post();
$the_id = get_the_ID();
// コース情報の取得
$course_id = learndash_get_course_id();
$cource_link = get_permalink( $course_id );
$cource_title = get_the_title( $course_id );
// コースカテゴリの取得
$terms = get_the_terms( $course_id, 'ld_course_category' );
$bc_cat = '';
if ( ! is_null( $terms ) ) {
$term_link = get_term_link( $terms[0]->slug, 'ld_course_category' );
$bc_cat = <<<EOD
<li class="bc-divider" style="display: none">></li>
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem" style="display: none">
<a href="{$term_link}" itemprop="item"><span itemprop="name">{$terms[0]->name}</span><meta itemprop="position" content="3"></a>
</li>
EOD;
}
// レッスン情報の取得
$lesson_id = learndash_get_lesson_id();
$lesson_link = get_permalink( $lesson_id );
$lesson_title = get_the_title( $lesson_id );
?>
<div class="kns-breadcrumb">
<ul itemscope="" itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem" style="display: none">
<a href="https://toiee.jp" itemprop="item"><span itemprop="name">home</span><meta itemprop="position" content="1"></a>
</li>
<li class="bc-divider" style="display: none">></li>
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem" style="display: none">
<a href="https://toiee.jp/project/toieelib/" itemprop="item"><span itemprop="name">といリブ</span><meta itemprop="position" content="2"></a>
</li>
<?php echo $bc_cat; ?>
<li class="bc-divider" style="display: none">></li>
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a href="<?php echo $cource_link; ?>" itemprop="item"><span itemprop="name"><?php echo $cource_title; ?></span><meta itemprop="position" content="4"></a>
</li>
<li class="bc-divider">></li>
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a href="<?php echo $lesson_link; ?>" itemprop="item"><span itemprop="name"><?php echo $lesson_title; ?></span><meta itemprop="position" content="5"></a>
</li>
<li class="bc-divider">></li>
<li><?php echo the_title(); ?></li>
</ul>
</div>
<?php echo the_title( '<h1>', '</h1>' ); ?>
<h2 class="main-subtitle"><?php echo get_post_meta( $the_id, 'kns_lead', true ); ?></h2>
<?php the_content(); ?>
<hr class="uk-divider-small uk-text-center">
<?php
the_post_navigation(
array(
'prev_text' => '< PREVIOUS',
'next_text' => 'NEXT >',
'screen_reader_text' => 'Navigation',
)
);
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
?>
<hr class="uk-margin-large">
<?php
comments_template();
endif;
endwhile; // End of the loop.
?>
</div><!-- .main-content -->
</div>
<!-- sidebar -->
<div id="___content-sidebar" class="uk-visible@m">
<nav>
<aside id="secondary" class="widget-area uk-padding-left">
<?php dynamic_sidebar( 'sidebar-ld_topic' ); ?>
</aside><!-- #secondary -->
</nav>
</div><!-- .sidebar -->
</div><!-- flex box -->
<?php
get_sidebar( 'ld_topic' );
get_footer();