Removes custom media sizes and uses existing ones. #43 and #45

This commit is contained in:
mateuswetah 2021-04-22 11:23:13 -03:00
parent c12abc6d6f
commit 16c42cc35d
3 changed files with 5 additions and 8 deletions

View File

@ -80,9 +80,6 @@ if ( ! function_exists( 'tainacan_setup' ) ) {
)); ));
} }
add_image_size( 'tainacan-interface-list-post', 300, 200, true );
add_image_size( 'tainacan-interface-item-attachments', 125, 125, true );
/** /**
* Gutenberg support * Gutenberg support
*/ */

View File

@ -10,7 +10,7 @@
<?php if ( has_post_thumbnail() ) : ?> <?php if ( has_post_thumbnail() ) : ?>
<div class="col-xs-12 col-md-4 blog-thumbnail align-self-center text-center mb-4 mb-md-0"> <div class="col-xs-12 col-md-4 blog-thumbnail align-self-center text-center mb-4 mb-md-0">
<a href="<?php the_permalink(); ?>"> <a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('tainacan-interface-list-post', array('class' => 'img-fluid')); ?> <?php the_post_thumbnail('medium_large', array('class' => 'img-fluid')); ?>
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -73,9 +73,9 @@
<?php endif; ?> <?php endif; ?>
<?php foreach ( $attachments as $attachment ) { ?> <?php foreach ( $attachments as $attachment ) { ?>
<div class="single-item-collection--attachments-file"> <div class="single-item-collection--attachments-file">
<div class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments')) echo'attachment-without-image'; ?>"> <div class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-medium')) echo'attachment-without-image'; ?>">
<?php <?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true ); echo wp_get_attachment_image( $attachment->ID, 'tainacan-medium', true );
echo '<br>'; echo '<br>';
?> ?>
<span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span> <span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span>
@ -96,12 +96,12 @@
?> ?>
<div class="single-item-collection--attachments-file"> <div class="single-item-collection--attachments-file">
<a <a
class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments')) echo'attachment-without-image'; ?>" class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-medium')) echo'attachment-without-image'; ?>"
href="<?php echo $href; ?>" href="<?php echo $href; ?>"
data-toggle="lightbox" data-toggle="lightbox"
data-gallery="example-gallery"> data-gallery="example-gallery">
<?php <?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true ); echo wp_get_attachment_image( $attachment->ID, 'tainacan-medium', true );
echo '<br>'; echo '<br>';
?> ?>
<span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span> <span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span>