ProPeler
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
wp-content
/
themes
/
bayisihat-jurnal
/
Filename :
single.php
back
Copy
<?php if (!defined('ABSPATH')) exit; get_header(); while(have_posts()): the_post(); $cat = bs_post_primary_cat(); ?> <?php echo bs_breadcrumbs_html(); ?> <article class="article"> <header class="wrap article__header"> <?php if ($cat): ?><a class="article__cat" href="<?php echo esc_url(get_category_link($cat)); ?>" style="--accent:<?php echo esc_attr(bs_accent($cat->slug)); ?>"><?php echo esc_html($cat->name); ?></a><?php endif; ?> <h1 class="article__title"><?php the_title(); ?></h1> <?php $ex = get_the_excerpt(); if ($ex): ?><p class="article__lead"><?php echo esc_html($ex); ?></p><?php endif; ?> <div class="article__meta"> <span><?php echo esc_html(bs_reading_time()); ?></span> <span aria-hidden="true">·</span> <span>Dikemas kini <?php echo esc_html(get_the_modified_date('j F Y')); ?></span> </div> <?php echo bs_share_buttons(); ?> </header> <?php if (has_post_thumbnail()): ?> <div class="article__hero reveal"><?php the_post_thumbnail('large', array('fetchpriority'=>'high','alt'=>get_the_title())); ?></div> <?php endif; ?> <div class="wrap article__wrap"> <?php $tk = get_post_meta(get_the_ID(),'bs_takeaway',true); if ($tk): ?> <div class="article__takeaway"><strong>Ringkasan pantas</strong><?php echo esc_html($tk); ?></div> <?php endif; ?> <div class="reviewed"> <?php echo bs_sprout('#2F5D50',20); ?> <div><strong>Disemak oleh Sidang Editorial Bayi Sihat.</strong> <?php $rn = get_post_meta(get_the_ID(),'bs_reviewed_note',true); echo $rn ? ' '.esc_html(rtrim($rn,'.')).'.' : ''; ?> Panduan umum — sila rujuk doktor atau klinik untuk kes khusus anda.</div> </div> <div class="article__body"> <?php the_content(); ?> </div> <?php echo bs_share_buttons(); ?> <?php $faq = bs_faq(); if ($faq): ?> <section class="faq"> <h2>Soalan Lazim</h2> <?php foreach ($faq as $f): if(empty($f['q'])||empty($f['a'])) continue; ?> <details class="faq__item"> <summary><?php echo esc_html($f['q']); ?></summary> <div class="faq__a"><?php echo esc_html($f['a']); ?></div> </details> <?php endforeach; ?> </section> <?php endif; ?> <div class="disclaimer"><strong>Penafian:</strong> Kandungan ini untuk tujuan pendidikan umum dan bukan pengganti nasihat perubatan profesional. Sila rujuk doktor, pakar atau klinik kesihatan untuk keadaan kesihatan tertentu anda dan bayi.</div> <?php if ($cat): $r = new WP_Query(array('category__in'=>array($cat->term_id),'posts_per_page'=>3,'post__not_in'=>array(get_the_ID()),'ignore_sticky_posts'=>true,'post_status'=>'publish')); if ($r->have_posts()): ?> <section class="related"> <h2>Baca juga</h2> <div class="post-grid"> <?php while($r->have_posts()): $r->the_post(); get_template_part('template-parts/card'); endwhile; wp_reset_postdata(); ?> </div> </section> <?php endif; endif; ?> </div> </article> <?php endwhile; get_footer(); ?>