Checks if the_colleciton_url function exists before using it for links.

This commit is contained in:
mateuswetah 2020-05-01 11:36:41 -03:00
parent fa45fc325d
commit 8f876a8f32
4 changed files with 45 additions and 17 deletions

View File

@ -80,7 +80,7 @@
} }
} }
> .page-header-hightlights { > .page-header-hightlights {
margin-top: 30px; margin-top: 24px;
@media only screen and (max-width: 992px) { @media only screen and (max-width: 992px) {
margin-top: 14px; margin-top: 14px;
} }

View File

@ -620,6 +620,10 @@
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
cursor: pointer; cursor: pointer;
word-break: break-all;
font-size: 0.875em;
padding: 0 14px;
@media only screen and (max-width: 380px) { @media only screen and (max-width: 380px) {
margin: 10px 0; margin: 10px 0;
} }

File diff suppressed because one or more lines are too long

View File

@ -31,26 +31,50 @@ if (get_theme_mod('tainacan_single_item_collection_header', false)) {
<div class="collection-name aside-thumbnail"> <div class="collection-name aside-thumbnail">
<div class="title-page"> <div class="title-page">
<p><?php echo __('Collection', 'tainacan-interface') ?></p> <p><?php echo __('Collection', 'tainacan-interface') ?></p>
<h1><a href="<?php tainacan_the_collection_url(); ?>"> <h1>
<?php tainacan_the_collection_name(); ?> <?php if ( function_exists('tainacan_the_collection_url') ): ?>
</a></h1> <a href="<?php tainacan_the_collection_url(); ?>">
<?php tainacan_the_collection_name(); ?>
</a>
<?php else : ?>
<span><?php tainacan_the_collection_name(); ?></span>
<?php endif; ?>
</h1>
</div> </div>
</div> </div>
</div> </div>
<div class="collection-thumbnail"> <div class="collection-thumbnail">
<a href="<?php tainacan_the_collection_url(); ?>"> <?php if ( function_exists('tainacan_the_collection_url') ): ?>
<?php if ( has_post_thumbnail( tainacan_get_collection_id() ) ) : <a href="<?php tainacan_the_collection_url(); ?>">
$thumbnail_id = get_post_thumbnail_id( $post->ID ); <?php if ( has_post_thumbnail( tainacan_get_collection_id() ) ) :
$alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true); ?> $thumbnail_id = get_post_thumbnail_id( $post->ID );
<img src="<?php echo get_the_post_thumbnail_url( tainacan_get_collection_id() ); ?>" class="t-collection--info-img rounded-circle img-fluid border border-white position-absolute text-left" alt="<?php echo esc_attr($alt); ?>"> $alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true); ?>
<img src="<?php echo get_the_post_thumbnail_url( tainacan_get_collection_id() ); ?>" class="t-collection--info-img rounded-circle img-fluid border border-white position-absolute text-left" alt="<?php echo esc_attr($alt); ?>">
<?php else : ?>
<div class="image-placeholder rounded-circle border border-white position-absolute">
<h4 class="text-center">
<?php
echo esc_html( tainacan_get_initials( tainacan_get_the_collection_name() ) );
?>
</h4>
</div>
<?php endif; ?>
<?php else : ?> <?php else : ?>
<div class="image-placeholder rounded-circle border border-white position-absolute"> <span>
<h4 class="text-center"> <?php if ( has_post_thumbnail( tainacan_get_collection_id() ) ) :
<?php $thumbnail_id = get_post_thumbnail_id( $post->ID );
echo esc_html( tainacan_get_initials( tainacan_get_the_collection_name() ) ); $alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true); ?>
?> <img src="<?php echo get_the_post_thumbnail_url( tainacan_get_collection_id() ); ?>" class="t-collection--info-img rounded-circle img-fluid border border-white position-absolute text-left" alt="<?php echo esc_attr($alt); ?>">
</h4> <?php else : ?>
</div> <div class="image-placeholder rounded-circle border border-white position-absolute">
<h4 class="text-center">
<?php
echo esc_html( tainacan_get_initials( tainacan_get_the_collection_name() ) );
?>
</h4>
</div>
<?php endif; ?>
</span>
<?php endif; ?> <?php endif; ?>
</a> </a>
</div> </div>