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:
164
page.php
164
page.php
@@ -2,9 +2,8 @@
|
||||
/**
|
||||
* The template for displaying all pages
|
||||
*
|
||||
* This is the template that displays all pages by default.
|
||||
* Please note that this is the WordPress construct of pages and that
|
||||
* other 'pages' on your WordPress site will use a different template.
|
||||
* 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/#single-page
|
||||
*
|
||||
@@ -15,112 +14,105 @@
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<main id="main-content" class="site-main" role="main">
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<main id="main-content" class="site-main" role="main">
|
||||
|
||||
<!-- Primary Content Area -->
|
||||
<div id="primary" class="content-area">
|
||||
<!-- 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();
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('featured-image');
|
||||
}
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
|
||||
<!-- Featured Image -->
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="post-thumbnail">
|
||||
<?php
|
||||
the_post_thumbnail(
|
||||
'roi-featured-large',
|
||||
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 -->
|
||||
<div class="entry-content">
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post-content'); ?>>
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
// Display page links for paginated pages
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'roi-theme' ),
|
||||
wp_link_pages(array(
|
||||
'before' => '<div class="page-links">' . esc_html__('Pages:', 'roi-theme'),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
));
|
||||
?>
|
||||
</div><!-- .entry-content -->
|
||||
</article>
|
||||
|
||||
<!-- Page Footer -->
|
||||
<?php if ( get_edit_post_link() ) : ?>
|
||||
<footer class="entry-footer">
|
||||
<!-- Share Buttons - Componente dinámico -->
|
||||
<?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>'
|
||||
);
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('social-share');
|
||||
}
|
||||
?>
|
||||
</footer><!-- .entry-footer -->
|
||||
<?php endif; ?>
|
||||
|
||||
</article><!-- #post-<?php the_ID(); ?> -->
|
||||
|
||||
<!-- CTA Post - Componente dinámico -->
|
||||
<?php
|
||||
// Display comments section if enabled
|
||||
if ( comments_open() || get_comments_number() ) :
|
||||
comments_template();
|
||||
endif;
|
||||
|
||||
endwhile; // End of the loop.
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('cta-post');
|
||||
}
|
||||
?>
|
||||
|
||||
</div><!-- #primary -->
|
||||
|
||||
<!-- Related Posts - Componente dinámico -->
|
||||
<?php
|
||||
/**
|
||||
* Sidebar
|
||||
* Display the sidebar if it's active.
|
||||
*/
|
||||
if ( is_active_sidebar( 'sidebar-1' ) ) :
|
||||
get_sidebar();
|
||||
endif;
|
||||
if (function_exists('roi_render_component')) {
|
||||
echo roi_render_component('related-post');
|
||||
}
|
||||
?>
|
||||
|
||||
</div><!-- .content-wrapper -->
|
||||
<!-- Ad After Related Posts -->
|
||||
<?php
|
||||
if (function_exists('roi_render_ad_slot')) {
|
||||
echo roi_render_ad_slot('after-related');
|
||||
}
|
||||
?>
|
||||
|
||||
</main><!-- #main-content -->
|
||||
</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