Edit File by line
/home/barbar84/public_h.../wp-conte.../themes/twentytw...
File: image.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* The template for displaying image attachments
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Twenty_Twenty_One
[5] Fix | Delete
* @since Twenty Twenty-One 1.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
get_header();
[9] Fix | Delete
[10] Fix | Delete
// Start the loop.
[11] Fix | Delete
while ( have_posts() ) {
[12] Fix | Delete
the_post();
[13] Fix | Delete
?>
[14] Fix | Delete
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
[15] Fix | Delete
<header class="entry-header alignwide">
[16] Fix | Delete
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
[17] Fix | Delete
</header><!-- .entry-header -->
[18] Fix | Delete
[19] Fix | Delete
<div class="entry-content">
[20] Fix | Delete
<figure class="wp-block-image">
[21] Fix | Delete
<?php
[22] Fix | Delete
/**
[23] Fix | Delete
* Filter the default image attachment size.
[24] Fix | Delete
*
[25] Fix | Delete
* @param string $image_size Image size. Default 'large'.
[26] Fix | Delete
*/
[27] Fix | Delete
$image_size = apply_filters( 'twenty_twenty_one_attachment_size', 'full' );
[28] Fix | Delete
echo wp_get_attachment_image( get_the_ID(), $image_size );
[29] Fix | Delete
?>
[30] Fix | Delete
[31] Fix | Delete
<?php if ( wp_get_attachment_caption() ) : ?>
[32] Fix | Delete
<figcaption class="wp-caption-text"><?php echo wp_kses_post( wp_get_attachment_caption() ); ?></figcaption>
[33] Fix | Delete
<?php endif; ?>
[34] Fix | Delete
</figure><!-- .wp-block-image -->
[35] Fix | Delete
[36] Fix | Delete
<?php
[37] Fix | Delete
the_content();
[38] Fix | Delete
[39] Fix | Delete
wp_link_pages(
[40] Fix | Delete
array(
[41] Fix | Delete
'before' => '<nav class="page-links" aria-label="' . esc_attr__( 'Page', 'twentytwentyone' ) . '">',
[42] Fix | Delete
'after' => '</nav>',
[43] Fix | Delete
/* translators: %: page number. */
[44] Fix | Delete
'pagelink' => esc_html__( 'Page %', 'twentytwentyone' ),
[45] Fix | Delete
)
[46] Fix | Delete
);
[47] Fix | Delete
?>
[48] Fix | Delete
</div><!-- .entry-content -->
[49] Fix | Delete
[50] Fix | Delete
<footer class="entry-footer default-max-width">
[51] Fix | Delete
<?php
[52] Fix | Delete
// Check if there is a parent, then add the published in link.
[53] Fix | Delete
if ( wp_get_post_parent_id( $post ) ) {
[54] Fix | Delete
echo '<span class="posted-on">';
[55] Fix | Delete
printf(
[56] Fix | Delete
/* translators: %s: parent post. */
[57] Fix | Delete
esc_html__( 'Published in %s', 'twentytwentyone' ),
[58] Fix | Delete
'<a href="' . esc_url( get_the_permalink( wp_get_post_parent_id( $post ) ) ) . '">' . esc_html( get_the_title( wp_get_post_parent_id( $post ) ) ) . '</a>'
[59] Fix | Delete
);
[60] Fix | Delete
echo '</span>';
[61] Fix | Delete
} else {
[62] Fix | Delete
// Edit post link.
[63] Fix | Delete
edit_post_link(
[64] Fix | Delete
sprintf(
[65] Fix | Delete
/* translators: %s: Name of current post. Only visible to screen readers. */
[66] Fix | Delete
esc_html__( 'Edit %s', 'twentytwentyone' ),
[67] Fix | Delete
'<span class="screen-reader-text">' . get_the_title() . '</span>'
[68] Fix | Delete
),
[69] Fix | Delete
'<span class="edit-link">',
[70] Fix | Delete
'</span>'
[71] Fix | Delete
);
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
// Retrieve attachment metadata.
[75] Fix | Delete
$metadata = wp_get_attachment_metadata();
[76] Fix | Delete
if ( $metadata ) {
[77] Fix | Delete
printf(
[78] Fix | Delete
'<span class="full-size-link"><span class="screen-reader-text">%1$s</span><a href="%2$s">%3$s &times; %4$s</a></span>',
[79] Fix | Delete
esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentytwentyone' ), // phpcs:ignore WordPress.Security.EscapeOutput
[80] Fix | Delete
esc_url( wp_get_attachment_url() ),
[81] Fix | Delete
absint( $metadata['width'] ),
[82] Fix | Delete
absint( $metadata['height'] )
[83] Fix | Delete
);
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
if ( wp_get_post_parent_id( $post ) ) {
[87] Fix | Delete
// Edit post link.
[88] Fix | Delete
edit_post_link(
[89] Fix | Delete
sprintf(
[90] Fix | Delete
/* translators: %s: Name of current post. Only visible to screen readers. */
[91] Fix | Delete
esc_html__( 'Edit %s', 'twentytwentyone' ),
[92] Fix | Delete
'<span class="screen-reader-text">' . get_the_title() . '</span>'
[93] Fix | Delete
),
[94] Fix | Delete
'<span class="edit-link">',
[95] Fix | Delete
'</span><br>'
[96] Fix | Delete
);
[97] Fix | Delete
}
[98] Fix | Delete
?>
[99] Fix | Delete
</footer><!-- .entry-footer -->
[100] Fix | Delete
</article><!-- #post-<?php the_ID(); ?> -->
[101] Fix | Delete
<?php
[102] Fix | Delete
// If comments are open or there is at least one comment, load up the comment template.
[103] Fix | Delete
if ( comments_open() || get_comments_number() ) {
[104] Fix | Delete
comments_template();
[105] Fix | Delete
}
[106] Fix | Delete
} // End the loop.
[107] Fix | Delete
[108] Fix | Delete
get_footer();
[109] Fix | Delete
[110] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function