diff --git a/inc/plugin.php b/inc/plugin.php index 8a60064..488703a 100644 --- a/inc/plugin.php +++ b/inc/plugin.php @@ -45,7 +45,6 @@ add_action('template_redirect', 'blocksy_tainacan_archive_templates_redirects'); */ if ( !function_exists('blocksy_tainacan_update_extensions_paths') ) { function blocksy_tainacan_update_extensions_paths($paths) { - var_dump($paths); return $paths; } } diff --git a/sass/tainacan-item-single.scss b/sass/tainacan-item-single.scss index 054ca1b..81882b3 100644 --- a/sass/tainacan-item-single.scss +++ b/sass/tainacan-item-single.scss @@ -5,8 +5,8 @@ // Overall page layout structure ------------------- @include display-grid; align-items: start; - grid-column-gap: 32px; - column-gap: 32px; + grid-column-gap: 48px; + column-gap: 48px; .tainacan-item-section { max-width: var(--block-max-width); @@ -223,7 +223,7 @@ @media only screen and (max-width: 380px) { margin: 10px 0; } - + img { border-radius: var(--borderRadius, 3px); width: var(--attachments-size, 140px); diff --git a/tainacan/archive-items.php b/tainacan/archive-items.php index ffb9c5b..996ccc2 100644 --- a/tainacan/archive-items.php +++ b/tainacan/archive-items.php @@ -55,38 +55,57 @@ $page_container_style .= 'background-color: var(--tainacan-background-color, #f8
$prefix ], - [] - ); - foreach ($hero_elements as $index => $single_hero_element) { - if ($single_hero_element['id'] == 'custom_thumbnail') { - $is_thumbnail_enabled = $single_hero_element['enabled']; + $thumbnail_element = ''; + $description_element = ''; + + $is_thumbnail_enabled = false; + $is_description_enabled = false; + + $hero_elements = blocksy_akg_or_customizer( + 'hero_elements', + [ 'prefix' => $prefix ], + [] + ); + foreach ($hero_elements as $index => $single_hero_element) { + if ($single_hero_element['id'] == 'custom_thumbnail' && $single_hero_element['enabled'] && 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); + + $thumbnail_element = ' +
+ ' . esc_attr($alt) . ' +
+ '; + } else if ($single_hero_element['id'] == 'custom_description' && $single_hero_element['enabled'] && get_the_archive_description()) { + $description_class = 'page-description'; + $description_class .= ' ' . blocksy_visibility_classes( + blocksy_akg( + 'description_visibility', + $single_hero_element, + [ + 'desktop' => true, + 'tablet' => true, + 'mobile' => false, + ] + ) + ); + $description_element = '
' . get_the_archive_description() . '
'; + } } - } - if ( $is_thumbnail_enabled && 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); - $thumbnail_element = ' -
- ' . esc_attr($alt) . ' -
- '; - - endif; - - $elements = $thumbnail_element . blocksy_render_view( - get_template_directory() . '/inc/components/hero/elements.php', [ 'type' => 'type-1' ] - ); - echo blocksy_output_hero_section([ - 'type' => 'type-1', - 'source' => false, - 'elements' => $elements - ]); + $elements = + $thumbnail_element . + blocksy_render_view( + get_template_directory() . '/inc/components/hero/elements.php', [ 'type' => 'type-1' ] + ) . + $description_element; + + echo blocksy_output_hero_section([ + 'type' => 'type-1', + 'source' => false, + 'elements' => $elements + ]); + ?>
diff --git a/tainacan/item-single-page.php b/tainacan/item-single-page.php index 7af9b65..2379cfc 100644 --- a/tainacan/item-single-page.php +++ b/tainacan/item-single-page.php @@ -24,9 +24,9 @@ if ($page_structure_type == 'type-gm' || $page_structure_type == 'type-mg') { $column_metadata_width = 100 - $column_documents_attachments_width; if ($page_structure_type == 'type-gm') { - $template_columns_style = 'grid-template-columns: ' . $column_documents_attachments_width . '% calc(' . $column_metadata_width . '% - 32px)'; + $template_columns_style = 'grid-template-columns: ' . $column_documents_attachments_width . '% calc(' . $column_metadata_width . '% - 48px)'; } else { - $template_columns_style = 'grid-template-columns: ' . $column_metadata_width . '% calc(' . $column_documents_attachments_width . '% - 32px)'; + $template_columns_style = 'grid-template-columns: ' . $column_metadata_width . '% calc(' . $column_documents_attachments_width . '% - 48px)'; } } ?>