Revert "refactor: remove legacy HeroSection component (orphaned code)"
This reverts commit e4c79d3f26.
This commit is contained in:
61
TemplateParts/content-hero.php
Normal file
61
TemplateParts/content-hero.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Hero Section Template
|
||||
*
|
||||
* Hero section con degradado azul para single posts
|
||||
*
|
||||
* @package ROI_Theme
|
||||
*/
|
||||
|
||||
if (!is_single()) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<section class="hero-section">
|
||||
<div class="container-fluid py-5">
|
||||
<div class="hero-content text-center">
|
||||
|
||||
<!-- Category Badges (ARRIBA del H1) -->
|
||||
<?php
|
||||
$categories = get_the_category();
|
||||
if (!empty($categories)) :
|
||||
?>
|
||||
<div class="hero-categories mb-3">
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
<?php if ($category->name !== 'Uncategorized' && $category->name !== 'Sin categoría') : ?>
|
||||
<span class="hero-category-badge"><?php echo esc_html($category->name); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- H1 Title -->
|
||||
<h1 class="hero-title"><?php the_title(); ?></h1>
|
||||
|
||||
<!-- Post Meta -->
|
||||
<div class="hero-meta">
|
||||
<span class="hero-meta-item">
|
||||
<i class="bi bi-calendar3 me-1"></i>
|
||||
<?php echo get_the_date(); ?>
|
||||
</span>
|
||||
<span class="hero-meta-separator">|</span>
|
||||
<span class="hero-meta-item">
|
||||
<i class="bi bi-person me-1"></i>
|
||||
<?php the_author(); ?>
|
||||
</span>
|
||||
<?php
|
||||
$reading_time = roi_get_reading_time();
|
||||
if ($reading_time) :
|
||||
?>
|
||||
<span class="hero-meta-separator">|</span>
|
||||
<span class="hero-meta-item">
|
||||
<i class="bi bi-clock me-1"></i>
|
||||
<?php echo esc_html($reading_time); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user