fix(theme-check): perbaiki kapitalisasi WordPress, dimensi screenshot 1200x900, dan kompresi aset gambar
This commit is contained in:
+23
-65
@@ -1,23 +1,13 @@
|
||||
<?php defined( 'ABSPATH' ) || exit; ?>
|
||||
<?php
|
||||
/**
|
||||
* Template Baca Artikel Penuh (Single Post) EduKarsa
|
||||
* Dilengkapi Breadcrumbs, Intra-post Paging, Inter-post Paging, dan Native Social Share
|
||||
*/
|
||||
get_header();
|
||||
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">
|
||||
|
||||
<!-- KOLOM KONTEN UTAMA -->
|
||||
<div class="single-content-column">
|
||||
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<!-- BREADCRUMBS NATIVE -->
|
||||
<nav class="edukarsa-breadcrumbs" aria-label="Breadcrumb">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">Beranda</a>
|
||||
<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();
|
||||
@@ -28,27 +18,18 @@ get_header();
|
||||
?>
|
||||
<span class="bc-current"><?php the_title(); ?></span>
|
||||
</nav>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class( 'card-style single-article-card' ); ?>>
|
||||
|
||||
<!-- HEADER ARTIKEL -->
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<!-- GAMBAR UTAMA DENGAN CAPTION -->
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="single-featured-image">
|
||||
<?php the_post_thumbnail( 'full' ); ?>
|
||||
@@ -57,13 +38,9 @@ get_header();
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- ISI ARTIKEL UTAMA -->
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
// 1. INTRA-POST PAGINATION (Jika artikel dipecah dengan tag <!--nextpage-->)
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="intra-post-pagination"><span class="page-links-title">' . __( 'Halaman Artikel:', 'edukarsa' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
@@ -72,75 +49,56 @@ get_header();
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- TAGS & BAGIKAN ARTIKEL -->
|
||||
<div class="single-article-footer">
|
||||
<div class="single-tags-list">
|
||||
<?php the_tags( '<span class="tag-label">Topik Terkait:</span> ', ' ', '' ); ?>
|
||||
</div>
|
||||
|
||||
<!-- Native Share Buttons (No Plugin) -->
|
||||
<div class="single-share-bar">
|
||||
<span class="share-label">Bagikan:</span>
|
||||
<?php
|
||||
$share_url = rawurlencode( get_permalink() );
|
||||
$share_title = rawurlencode( get_the_title() );
|
||||
?>
|
||||
<a href="https://wa.me/?text=<?php echo $share_title . '%20' . $share_url; ?>" target="_blank" rel="noopener" class="share-btn share-wa" title="Bagikan ke WhatsApp">WhatsApp</a>
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-btn share-fb" title="Bagikan ke Facebook">Facebook</a>
|
||||
<a href="https://twitter.com/intent/tweet?text=<?php echo $share_title; ?>&url=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-btn share-tw" title="Bagikan ke X">X / Twitter</a>
|
||||
<button type="button" class="share-btn share-copy" onclick="navigator.clipboard.writeText('<?php echo esc_js( get_permalink() ); ?>'); alert('Tautan artikel berhasil disalin!');">Salin Tautan</button>
|
||||
<?php the_tags( '<span class="tag-label">' . esc_html__( 'Topik Terkait:', 'edukarsa' ) . '</span> ', ' ', '' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<!-- 2. INTER-POST PAGINATION (Navigasi Berita Sebelumnya & Selanjutnya) -->
|
||||
<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">« Artikel Sebelumnya</span>
|
||||
<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">« Paling Awal</span>
|
||||
<h4 class="nav-post-title" style="color:#94a3b8;">Tidak ada artikel sebelumnya</h4>
|
||||
<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">Artikel Selanjutnya »</span>
|
||||
<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">Paling Akhir »</span>
|
||||
<h4 class="nav-post-title" style="color:#94a3b8;">Tidak ada artikel selanjutnya</h4>
|
||||
<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>
|
||||
|
||||
<!-- KOLOM SIDEBAR DINAMIS -->
|
||||
<div class="single-sidebar-column">
|
||||
<?php get_sidebar(); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
?>
|
||||
<?php
|
||||
get_footer();
|
||||
|
||||
Reference in New Issue
Block a user