Files
roi-theme/wp-content/themes/apus-theme/template-parts/content.php
FrankZamora 7ba9080f57 Agregar estructura completa del tema APUS con Bootstrap 5 y optimizaciones de rendimiento
Se implementa tema WordPress personalizado para Análisis de Precios Unitarios con funcionalidades avanzadas:
- Sistema de templates (front-page, single, archive, page, 404, search)
- Integración de Bootstrap 5.3.8 con estructura modular de assets
- Panel de opciones del tema con Customizer API
- Optimizaciones de rendimiento (Critical CSS, Image Optimization, Performance)
- Funcionalidades SEO y compatibilidad con Rank Math
- Sistema de posts relacionados y tabla de contenidos
- Badge de categorías y manejo de AdSense diferido
- Tipografías Google Fonts configurables
- Documentación completa del tema y guías de uso

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 09:31:47 -06:00

155 lines
4.0 KiB
PHP

<?php
/**
* Template part for displaying posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Apus_Theme
* @since 1.0.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- Post Header -->
<header class="entry-header">
<?php
// Display the post title
if ( is_singular() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
endif;
// Display post meta information
if ( 'post' === get_post_type() ) :
?>
<div class="entry-meta">
<?php
// Posted on date
printf(
'<span class="posted-on"><time class="entry-date published" datetime="%1$s">%2$s</time></span>',
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
// Posted by author
printf(
'<span class="byline"> %s <span class="author vcard"><a class="url fn n" href="%s">%s</a></span></span>',
esc_html__( 'by', 'apus-theme' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
);
// Comments link
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
echo '<span class="comments-link">';
comments_popup_link(
esc_html__( 'Leave a comment', 'apus-theme' ),
esc_html__( '1 Comment', 'apus-theme' ),
esc_html__( '% Comments', 'apus-theme' )
);
echo '</span>';
endif;
?>
</div><!-- .entry-meta -->
<?php
endif;
?>
</header><!-- .entry-header -->
<!-- Featured Image -->
<?php if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<?php
if ( is_singular() ) :
the_post_thumbnail( 'apus-featured-large', array( 'alt' => the_title_attribute( array( 'echo' => false ) ) ) );
else :
?>
<a href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
<?php the_post_thumbnail( 'apus-featured-medium', array( 'alt' => the_title_attribute( array( 'echo' => false ) ) ) ); ?>
</a>
<?php
endif;
?>
</div><!-- .post-thumbnail -->
<?php endif; ?>
<!-- Post Content -->
<div class="entry-content">
<?php
// Display content or excerpt based on context
if ( is_singular() ) :
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'apus-theme' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);
// Display pagination for multi-page posts
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'apus-theme' ),
'after' => '</div>',
)
);
else :
the_excerpt();
endif;
?>
</div><!-- .entry-content -->
<!-- Post Footer -->
<footer class="entry-footer">
<?php
// Display categories
$categories_list = get_the_category_list( esc_html__( ', ', 'apus-theme' ) );
if ( $categories_list ) :
printf(
'<span class="cat-links">%s %s</span>',
esc_html__( 'Categories:', 'apus-theme' ),
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
);
endif;
// Display tags
$tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'apus-theme' ) );
if ( $tags_list ) :
printf(
'<span class="tags-links">%s %s</span>',
esc_html__( 'Tags:', 'apus-theme' ),
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
);
endif;
// Edit post link
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'apus-theme' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
),
'<span class="edit-link">',
'</span>'
);
?>
</footer><!-- .entry-footer -->
</article><!-- #post-<?php the_ID(); ?> -->