refactor(template): unificar page.php con estructura de single.php

- Grid layout col-lg-9 + col-lg-3
- Incluye todos los componentes: hero, featured-image, social-share,
  cta-post, related-post, table-of-contents, cta-box-sidebar, contact-form
- Permite que cta-box-sidebar se muestre en páginas cuando show_on_pages=all

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-12-02 11:36:36 -06:00
parent 4cdc4db397
commit 7fb5eda108

154
page.php
View File

@@ -2,9 +2,8 @@
/** /**
* The template for displaying all pages * The template for displaying all pages
* *
* This is the template that displays all pages by default. * Replica la estructura de single.php para consistencia visual.
* Please note that this is the WordPress construct of pages and that * Grid layout: col-lg-9 (contenido) + col-lg-3 (sidebar)
* other 'pages' on your WordPress site will use a different template.
* *
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-page * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-page
* *
@@ -15,112 +14,105 @@
get_header(); get_header();
?> ?>
<?php while (have_posts()) : the_post(); ?>
<main id="main-content" class="site-main" role="main"> <main id="main-content" class="site-main" role="main">
<div class="content-wrapper"> <!-- Hero Section - Componente dinámico -->
<!-- Primary Content Area -->
<div id="primary" class="content-area">
<?php <?php
while ( have_posts() ) : if (function_exists('roi_render_component')) {
the_post(); echo roi_render_component('hero');
}
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <!-- Main Content Grid -->
<div class="container">
<div class="row">
<!-- Featured Image --> <!-- Main Content Column (col-lg-9) -->
<?php if ( has_post_thumbnail() ) : ?> <div class="col-lg-9">
<div class="post-thumbnail">
<!-- Featured Image - Componente dinámico -->
<?php <?php
the_post_thumbnail( if (function_exists('roi_render_component')) {
'roi-featured-large', echo roi_render_component('featured-image');
array( }
'alt' => the_title_attribute(
array(
'echo' => false,
)
),
'loading' => 'eager',
)
);
?> ?>
</div>
<?php endif; ?>
<!-- Page Header -->
<header class="entry-header">
<h1 class="entry-title">
<?php the_title(); ?>
</h1>
</header><!-- .entry-header -->
<!-- Page Content --> <!-- Page Content -->
<div class="entry-content"> <article id="post-<?php the_ID(); ?>" <?php post_class('post-content'); ?>>
<?php <?php
the_content(); the_content();
// Display page links for paginated pages wp_link_pages(array(
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__('Pages:', 'roi-theme'), 'before' => '<div class="page-links">' . esc_html__('Pages:', 'roi-theme'),
'after' => '</div>', 'after' => '</div>',
) ));
);
?> ?>
</div><!-- .entry-content --> </article>
<!-- Page Footer --> <!-- Share Buttons - Componente dinámico -->
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php <?php
// Edit post link for logged-in users with permission if (function_exists('roi_render_component')) {
edit_post_link( echo roi_render_component('social-share');
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(); ?> -->
<!-- CTA Post - Componente dinámico -->
<?php <?php
// Display comments section if enabled if (function_exists('roi_render_component')) {
if ( comments_open() || get_comments_number() ) : echo roi_render_component('cta-post');
comments_template(); }
endif;
endwhile; // End of the loop.
?> ?>
</div><!-- #primary --> <!-- Related Posts - Componente dinámico -->
<?php <?php
/** if (function_exists('roi_render_component')) {
* Sidebar echo roi_render_component('related-post');
* Display the sidebar if it's active. }
*/
if ( is_active_sidebar( 'sidebar-1' ) ) :
get_sidebar();
endif;
?> ?>
</div><!-- .content-wrapper --> <!-- 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 --> </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 <?php
get_footer(); get_footer();