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 {
margin-top: 30px;
margin-top: 24px;
@media only screen and (max-width: 992px) {
margin-top: 14px;
}

View File

@ -620,6 +620,10 @@
display: inline-block;
vertical-align: top;
cursor: pointer;
word-break: break-all;
font-size: 0.875em;
padding: 0 14px;
@media only screen and (max-width: 380px) {
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="title-page">
<p><?php echo __('Collection', 'tainacan-interface') ?></p>
<h1><a href="<?php tainacan_the_collection_url(); ?>">
<?php tainacan_the_collection_name(); ?>
</a></h1>
<h1>
<?php if ( function_exists('tainacan_the_collection_url') ): ?>
<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 class="collection-thumbnail">
<a href="<?php tainacan_the_collection_url(); ?>">
<?php if ( has_post_thumbnail( tainacan_get_collection_id() ) ) :
$thumbnail_id = get_post_thumbnail_id( $post->ID );
$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 if ( function_exists('tainacan_the_collection_url') ): ?>
<a href="<?php tainacan_the_collection_url(); ?>">
<?php if ( has_post_thumbnail( tainacan_get_collection_id() ) ) :
$thumbnail_id = get_post_thumbnail_id( $post->ID );
$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 : ?>
<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>
<span>
<?php if ( has_post_thumbnail( tainacan_get_collection_id() ) ) :
$thumbnail_id = get_post_thumbnail_id( $post->ID );
$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; ?>
</span>
<?php endif; ?>
</a>
</div>