chore: inisialisasi repo tema edukarsa
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* File template utama (Fallback untuk semua halaman)
|
||||
* Digunakan untuk menampilkan daftar berita/artikel terbaru jika halaman khusus tidak ditemukan.
|
||||
*/
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<main id="primary" class="site-main" style="padding: 40px 5%; font-family: sans-serif; color: #333; max-width: 1200px; margin: 0 auto; min-height: 60vh;">
|
||||
|
||||
<header class="page-header" style="margin-bottom: 40px; text-align: center;">
|
||||
<h1 class="page-title" style="color: #2c3e50; border-bottom: 3px solid #3498db; display: inline-block; padding-bottom: 10px; margin: 0;">
|
||||
<?php
|
||||
if ( is_home() && ! is_front_page() ) {
|
||||
single_post_title();
|
||||
} elseif ( is_archive() ) {
|
||||
the_archive_title();
|
||||
} elseif ( is_search() ) {
|
||||
echo 'Hasil Pencarian: ' . get_search_query();
|
||||
} else {
|
||||
echo 'Berita & Pengumuman';
|
||||
}
|
||||
?>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<div class="post-list" style="display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px;">
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="background: #ffffff; border-radius: 8px; border: 1px solid #e1e8ed; overflow: hidden; transition: box-shadow 0.3s; display: flex; flex-direction: column;">
|
||||
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php the_post_thumbnail( 'medium_large', array( 'style' => 'width: 100%; height: 200px; object-fit: cover; display: block;' ) ); ?>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<!-- Placeholder jika artikel tidak memiliki gambar unggulan -->
|
||||
<div style="width: 100%; height: 200px; background: #ecf0f1; display: flex; align-items: center; justify-content: center; color: #95a5a6;">
|
||||
<span>Gambar Tidak Tersedia</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="entry-content" style="padding: 20px; flex-grow: 1; display: flex; flex-direction: column;">
|
||||
<header class="entry-header">
|
||||
<h2 class="entry-title" style="margin: 0 0 10px; font-size: 20px; line-height: 1.4;">
|
||||
<a href="<?php the_permalink(); ?>" style="text-decoration: none; color: #2c3e50; font-weight: bold;"><?php the_title(); ?></a>
|
||||
</h2>
|
||||
<div class="entry-meta" style="font-size: 13px; color: #7f8c8d; margin-bottom: 15px;">
|
||||
<span>📅 <?php echo get_the_date(); ?></span> |
|
||||
<span>👤 <?php the_author(); ?></span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="entry-summary" style="color: #555; line-height: 1.6; font-size: 14px; margin-bottom: 20px; flex-grow: 1;">
|
||||
<?php
|
||||
// Menampilkan kutipan (excerpt) artikel
|
||||
the_excerpt();
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: auto;">
|
||||
<a href="<?php the_permalink(); ?>" style="display: inline-block; padding: 8px 15px; background: #2c3e50; color: #fff; text-decoration: none; border-radius: 4px; font-size: 14px; transition: background 0.3s;">
|
||||
Baca Selengkapnya »
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php
|
||||
endwhile;
|
||||
|
||||
?>
|
||||
</div> <!-- Akhir dari post-list grid -->
|
||||
|
||||
<div class="pagination" style="margin-top: 50px; text-align: center;">
|
||||
<?php
|
||||
// Menampilkan tombol Halaman Selanjutnya / Sebelumnya
|
||||
the_posts_pagination( array(
|
||||
'prev_text' => __( '« Sebelumnya', 'edukarsa' ),
|
||||
'next_text' => __( 'Selanjutnya »', 'edukarsa' ),
|
||||
'before_page_number' => '<span style="padding: 5px 10px; background: #eee; margin: 0 2px; border-radius: 3px;">',
|
||||
'after_page_number' => '</span>',
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
<!-- Jika tidak ada postingan sama sekali -->
|
||||
</div> <!-- Tutup div post-list agar layout tidak berantakan -->
|
||||
<div style="text-align: center; width: 100%; padding: 50px 20px; background: #fdfdfe; border: 1px dashed #bdc3c7; border-radius: 8px;">
|
||||
<h2 style="color: #e74c3c; margin-top: 0;">Belum Ada Berita</h2>
|
||||
<p style="color: #7f8c8d; font-size: 16px;">Maaf, saat ini belum ada artikel, berita, atau pengumuman yang dipublikasikan.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</main>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
?>
|
||||
Reference in New Issue
Block a user