diff --git a/src/assets/scss/_post.scss b/src/assets/scss/_post.scss index 5164b1e..defbb39 100644 --- a/src/assets/scss/_post.scss +++ b/src/assets/scss/_post.scss @@ -612,6 +612,7 @@ display: flex; justify-content: center; align-items: center; + flex-direction: column; min-height: 10vh; > iframe, img.attachment-large { @@ -642,6 +643,37 @@ bottom: 0; } } + + .document-metadata { + text-align: center; + + &.hide-name .document-metadata__name { + display: none; + visibility: hidden; + } + &.hide-description .document-metadata__description { + display: none; + visibility: hidden; + } + &.hide-caption .document-metadata__caption { + display: none; + visibility: hidden; + } + } + + .document-metadata__name { + font-size: 1em; + font-weight: bold; + color: var(--tainacan-label-color, #454647); + } + .document-metadata__caption { + font-size: 0.9375em; + color: var(--tainacan-input-color, #1d1d1d); + } + .document-metadata__caption { + font-size: 0.875em; + color: var(--tainacan-info-color, #555758); + } } .single-item-collection--attachments-prev, .single-item-collection--attachments-next { diff --git a/src/template-parts/single-items-attachments_new.php b/src/template-parts/single-items-attachments_new.php index 2449fda..1f40cfb 100644 --- a/src/template-parts/single-items-attachments_new.php +++ b/src/template-parts/single-items-attachments_new.php @@ -47,7 +47,7 @@ if ( !empty( $attachments ) || ( get_theme_mod( 'tainacan_single_item_gallery_m 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document(0, 'full') : ('
' . tainacan_get_the_document(0, 'full') . '
'), 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw()) : '', 'media_description' => $is_document_type_attachment ? get_the_content(tainacan_get_the_document_raw()) : '', - 'media_caption' => $is_document_type_attachment ? get_the_excerpt(tainacan_get_the_document_raw()) : '', + 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw()) : '', 'media_type' => tainacan_get_the_document_type(), 'class_slide_metadata' => $class_slide_metadata )); @@ -81,7 +81,7 @@ if ( !empty( $attachments ) || ( get_theme_mod( 'tainacan_single_item_gallery_m 'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document(0, 'full') : ('
' . tainacan_get_the_document(0, 'full') . '
'), 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw()) : '', 'media_description' => $is_document_type_attachment ? get_the_content(tainacan_get_the_document_raw()) : '', - 'media_caption' => $is_document_type_attachment ? get_the_excerpt(tainacan_get_the_document_raw()) : '', + 'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw()) : '', 'media_type' => tainacan_get_the_document_type(), 'class_slide_metadata' => 'hide-caption hide-description ' . ( get_theme_mod('tainacan_single_item_hide_files_name', false) ? 'hide-name' : '' ) )); diff --git a/src/template-parts/single-items-document.php b/src/template-parts/single-items-document.php index 637851c..051741e 100644 --- a/src/template-parts/single-items-document.php +++ b/src/template-parts/single-items-document.php @@ -1,4 +1,22 @@ - += 0) { + $hide_file_name = get_theme_mod('tainacan_single_item_hide_files_name_main', true); + $hide_file_caption = get_theme_mod('tainacan_single_item_hide_files_caption_main', true); + $hide_file_description = get_theme_mod('tainacan_single_item_hide_files_description_main', true); + $is_document_type_attachment = tainacan_get_the_document_type() === 'attachment'; + + $class_slide_metadata = ''; + + if ($hide_file_name) + $class_slide_metadata .= ' hide-name'; + if ($hide_file_description) + $class_slide_metadata .= ' hide-description'; + if ($hide_file_caption) + $class_slide_metadata .= ' hide-caption'; +} + +if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mode', false )) : ?>

@@ -9,9 +27,32 @@
' . tainacan_the_item_document_download_link() . ''; - } + + if ( version_compare(TAINACAN_VERSION, '0.18RC') >= 0 ) {?> + +