Files
roi-theme/template-parts/content.php
FrankZamora bbc6ed2c98 Refactor: Reorganizar repositorio - Solo tema WordPress
Se movió el repositorio git desde la raíz de WordPress a la carpeta del tema.
Este commit limpia todos los archivos de WordPress del historial de tracking
y mantiene únicamente los archivos del tema apus-theme.

Cambios:
- Eliminado tracking de archivos de WordPress core
- Mantenido solo archivos del tema (97 archivos)
- Actualizado .gitignore para excluir carpetas de desarrollo
- Historial de commits anteriores se mantiene intacto

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 09:15: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(); ?> -->