COMPLETADO: Fase 1 de la migración a Clean Architecture + POO ## Estructura de Carpetas - ✓ Estructura completa de 4 capas (Domain, Application, Infrastructure, Presentation) - ✓ Carpetas de Use Cases (SaveComponent, GetComponent, DeleteComponent, SyncSchema) - ✓ Estructura de tests (Unit, Integration, E2E) - ✓ Carpetas de schemas y templates ## Composer y Autoloading - ✓ PSR-4 autoloading configurado para ROITheme namespace - ✓ Autoloader optimizado regenerado ## DI Container - ✓ DIContainer implementado con patrón Singleton - ✓ Métodos set(), get(), has() para gestión de servicios - ✓ Getters específicos para ComponentRepository, ValidationService, CacheService - ✓ Placeholders que serán implementados en Fase 5 - ✓ Prevención de clonación y deserialización ## Interfaces - ✓ ComponentRepositoryInterface (Domain) - ✓ ValidationServiceInterface (Application) - ✓ CacheServiceInterface (Application) - ✓ Component entity placeholder (Domain) ## Bootstrap - ✓ functions.php actualizado con carga de Composer autoloader - ✓ Inicialización del DIContainer - ✓ Helper function roi_container() disponible globalmente ## Tests - ✓ 10 tests unitarios para DIContainer (100% cobertura) - ✓ Total: 13 tests unitarios, 28 assertions - ✓ Suite de tests pasando correctamente ## Validación - ✓ Script de validación automatizado (48/48 checks pasados) - ✓ 100% de validaciones exitosas La arquitectura base está lista para la Fase 2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
131 lines
3.2 KiB
PHP
131 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* The template for displaying the static front page
|
|
*
|
|
* Structure replicates template index.html lines 322-345 (Hero Section)
|
|
*
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#front-page
|
|
*
|
|
* @package ROI_Theme
|
|
* @since 1.0.0
|
|
*/
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<!-- Hero Title Section (Template líneas 322-345) -->
|
|
<div class="container-fluid py-5 mb-4 hero-title">
|
|
<div class="container">
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
|
|
// Categories Section
|
|
$categories = get_the_category();
|
|
if ( ! empty( $categories ) && count( $categories ) > 0 ) :
|
|
?>
|
|
<div class="mb-3 d-flex justify-content-center">
|
|
<div class="d-flex gap-2 flex-wrap justify-content-center">
|
|
<?php
|
|
// Limit to 3 categories max
|
|
$cat_count = 0;
|
|
foreach ( $categories as $category ) :
|
|
if ( $cat_count >= 3 ) break;
|
|
if ( $category->slug === 'uncategorized' ) continue;
|
|
?>
|
|
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>" class="category-badge category-badge-hero">
|
|
<i class="bi bi-folder-fill me-1"></i>
|
|
<?php echo esc_html( $category->name ); ?>
|
|
</a>
|
|
<?php
|
|
$cat_count++;
|
|
endforeach;
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Page Title -->
|
|
<h1 class="display-5 fw-bold text-center">
|
|
<?php the_title(); ?>
|
|
</h1>
|
|
<?php endwhile; ?>
|
|
</div><!-- .container -->
|
|
</div><!-- .hero-title -->
|
|
|
|
<main id="main-content" class="site-main front-page" role="main">
|
|
|
|
<!-- Container Bootstrap (Template línea 347) -->
|
|
<div class="container">
|
|
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
?>
|
|
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
|
|
|
<!-- Front Page Content -->
|
|
<div class="entry-content">
|
|
<?php
|
|
the_content();
|
|
|
|
// Display page links for paginated pages
|
|
wp_link_pages(
|
|
array(
|
|
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'roi-theme' ),
|
|
'after' => '</div>',
|
|
)
|
|
);
|
|
?>
|
|
</div><!-- .entry-content -->
|
|
|
|
<!-- Front Page Footer -->
|
|
<?php if ( get_edit_post_link() ) : ?>
|
|
<footer class="entry-footer">
|
|
<?php
|
|
// Edit post link for logged-in users with permission
|
|
edit_post_link(
|
|
sprintf(
|
|
wp_kses(
|
|
/* translators: %s: Page title. Only visible to screen readers. */
|
|
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'roi-theme' ),
|
|
array(
|
|
'span' => array(
|
|
'class' => array(),
|
|
),
|
|
)
|
|
),
|
|
get_the_title()
|
|
),
|
|
'<span class="edit-link">',
|
|
'</span>'
|
|
);
|
|
?>
|
|
</footer><!-- .entry-footer -->
|
|
<?php endif; ?>
|
|
|
|
</article><!-- #post-<?php the_ID(); ?> -->
|
|
|
|
<?php
|
|
// Display comments section if enabled
|
|
if ( comments_open() || get_comments_number() ) :
|
|
comments_template();
|
|
endif;
|
|
|
|
endwhile; // End of the loop.
|
|
|
|
/**
|
|
* Hook to display additional content on front page
|
|
* This can be used to add featured posts, testimonials, etc.
|
|
*/
|
|
do_action( 'roi_front_page_content' );
|
|
?>
|
|
|
|
</div><!-- .container -->
|
|
|
|
</main><!-- #main-content -->
|
|
|
|
<?php
|
|
get_footer();
|