feat(visibility): sistema de visibilidad por tipo de página
- Añadir PageVisibility use case y repositorio - Implementar PageTypeDetector para detectar home/single/page/archive - Actualizar FieldMappers con soporte show_on_[page_type] - Extender FormBuilders con UI de visibilidad por página - Refactorizar Renderers para evaluar visibilidad dinámica - Limpiar schemas removiendo campos de visibilidad legacy - Añadir MigrationCommand para migrar configuraciones existentes - Implementar adsense-loader.js para carga lazy de ads - Actualizar front-page.php con nueva estructura - Extender DIContainer con nuevos servicios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
206
front-page.php
206
front-page.php
@@ -2,7 +2,8 @@
|
||||
/**
|
||||
* The template for displaying the static front page
|
||||
*
|
||||
* Structure replicates template index.html lines 322-345 (Hero Section)
|
||||
* Replica la estructura de single.php para consistencia visual.
|
||||
* Grid layout: col-lg-9 (contenido) + col-lg-3 (sidebar)
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#front-page
|
||||
*
|
||||
@@ -13,118 +14,105 @@
|
||||
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(); ?>
|
||||
|
||||
<main id="main-content" class="site-main" role="main">
|
||||
|
||||
<!-- Hero Section - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('hero');
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Main Content Grid -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<!-- Main Content Column (col-lg-9) -->
|
||||
<div class="col-lg-9">
|
||||
|
||||
<!-- Featured Image - Componente dinámico -->
|
||||
<?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' );
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('featured-image');
|
||||
}
|
||||
?>
|
||||
|
||||
</div><!-- .container -->
|
||||
<!-- Page Content -->
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post-content'); ?>>
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
</main><!-- #main-content -->
|
||||
wp_link_pages(array(
|
||||
'before' => '<div class="page-links">' . esc_html__('Pages:', 'roi-theme'),
|
||||
'after' => '</div>',
|
||||
));
|
||||
?>
|
||||
</article>
|
||||
|
||||
<!-- Share Buttons - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('social-share');
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- CTA Post - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('cta-post');
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Related Posts - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('related-post');
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Ad After Related Posts -->
|
||||
<?php
|
||||
if (function_exists('roi_render_ad_slot')) {
|
||||
echo roi_render_ad_slot('after-related');
|
||||
}
|
||||
?>
|
||||
|
||||
</div><!-- .col-lg-9 -->
|
||||
|
||||
<!-- Sidebar Column (col-lg-3) -->
|
||||
<div class="col-lg-3">
|
||||
<div class="sidebar-sticky">
|
||||
<!-- Table of Contents - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('table-of-contents');
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- CTA Box Sidebar - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('cta-box-sidebar');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- .row -->
|
||||
</div><!-- .container -->
|
||||
|
||||
</main><!-- #main-content -->
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<!-- Contact Form Section - Componente dinámico -->
|
||||
<?php
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('contact-form');
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
|
||||
Reference in New Issue
Block a user