105 lines
5.9 KiB
PHP
105 lines
5.9 KiB
PHP
<?php
|
|
defined( 'ABSPATH' ) || exit;
|
|
get_header();
|
|
?>
|
|
<main id="primary" class="site-main" style="padding: 45px 0 70px; background-color: #f8fafc; min-height: 75vh;">
|
|
<div class="container single-layout-wrapper">
|
|
<div class="single-content-column">
|
|
<?php while ( have_posts() ) : the_post(); ?>
|
|
<nav class="edukarsa-breadcrumbs" aria-label="<?php esc_attr_e( 'Breadcrumb', 'edukarsa' ); ?>">
|
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Beranda', 'edukarsa' ); ?></a>
|
|
<span class="bc-sep">/</span>
|
|
<?php
|
|
$categories = get_the_category();
|
|
if ( ! empty( $categories ) ) {
|
|
echo '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>';
|
|
echo '<span class="bc-sep">/</span>';
|
|
}
|
|
?>
|
|
<span class="bc-current"><?php the_title(); ?></span>
|
|
</nav>
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class( 'card-style single-article-card' ); ?>>
|
|
<header class="entry-header">
|
|
<?php if ( ! empty( $categories ) ) : ?>
|
|
<span class="badge-title"><?php echo esc_html( $categories[0]->name ); ?></span>
|
|
<?php endif; ?>
|
|
<h1 class="single-article-title"><?php the_title(); ?></h1>
|
|
<div class="single-meta-bar">
|
|
<span>📅 <?php echo get_the_date( 'l, d F Y' ); ?></span>
|
|
<span>👤 <?php the_author(); ?></span>
|
|
<span>⏱ <?php echo ceil( str_word_count( strip_tags( get_the_content() ) ) / 200 ); ?> Menit Baca</span>
|
|
</div>
|
|
</header>
|
|
<?php if ( has_post_thumbnail() ) : ?>
|
|
<div class="single-featured-image">
|
|
<?php the_post_thumbnail( 'full' ); ?>
|
|
<?php if ( get_the_post_thumbnail_caption() ) : ?>
|
|
<figcaption class="img-caption"><?php the_post_thumbnail_caption(); ?></figcaption>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="entry-content">
|
|
<?php
|
|
the_content();
|
|
wp_link_pages( array(
|
|
'before' => '<div class="intra-post-pagination"><span class="page-links-title">' . __( 'Halaman Artikel:', 'edukarsa' ) . '</span>',
|
|
'after' => '</div>',
|
|
'link_before' => '<span class="page-number-box">',
|
|
'link_after' => '</span>',
|
|
) );
|
|
?>
|
|
</div>
|
|
<div class="single-article-footer">
|
|
<div class="single-tags-list">
|
|
<?php the_tags( '<span class="tag-label">' . esc_html__( 'Topik Terkait:', 'edukarsa' ) . '</span> ', ' ', '' ); ?>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
|
|
<nav class="inter-post-nav">
|
|
<?php
|
|
$prev_post = get_previous_post();
|
|
$next_post = get_next_post();
|
|
?>
|
|
<div class="nav-box nav-box-prev card-style <?php echo empty($prev_post) ? 'disabled' : ''; ?>">
|
|
<?php if ( ! empty( $prev_post ) ) : ?>
|
|
<a href="<?php echo esc_url( get_permalink( $prev_post->ID ) ); ?>" class="nav-box-link">
|
|
<span class="nav-direction">« <?php esc_html_e( 'Artikel Sebelumnya', 'edukarsa' ); ?></span>
|
|
<h4 class="nav-post-title"><?php echo esc_html( wp_trim_words( $prev_post->post_title, 9, '...' ) ); ?></h4>
|
|
</a>
|
|
<?php else : ?>
|
|
<span class="nav-direction">« <?php esc_html_e( 'Paling Awal', 'edukarsa' ); ?></span>
|
|
<h4 class="nav-post-title" style="color:#94a3b8;"><?php esc_html_e( 'Tidak ada artikel sebelumnya', 'edukarsa' ); ?></h4>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="nav-box nav-box-next card-style <?php echo empty($next_post) ? 'disabled' : ''; ?>">
|
|
<?php if ( ! empty( $next_post ) ) : ?>
|
|
<a href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>" class="nav-box-link text-right">
|
|
<span class="nav-direction"><?php esc_html_e( 'Artikel Selanjutnya', 'edukarsa' ); ?> »</span>
|
|
<h4 class="nav-post-title"><?php echo esc_html( wp_trim_words( $next_post->post_title, 9, '...' ) ); ?></h4>
|
|
</a>
|
|
<?php else : ?>
|
|
<div class="text-right">
|
|
<span class="nav-direction"><?php esc_html_e( 'Paling Akhir', 'edukarsa' ); ?> »</span>
|
|
<h4 class="nav-post-title" style="color:#94a3b8;"><?php esc_html_e( 'Tidak ada artikel selanjutnya', 'edukarsa' ); ?></h4>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</nav>
|
|
|
|
<?php
|
|
if ( comments_open() || get_comments_number() ) :
|
|
comments_template();
|
|
endif;
|
|
?>
|
|
|
|
<?php endwhile; ?>
|
|
</div>
|
|
<div class="single-sidebar-column">
|
|
<?php get_sidebar(); ?>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<?php
|
|
get_footer();
|