Skip to content

Commit

Permalink
#23 Remoção de funções da tela e colocadas arquivo separado
Browse files Browse the repository at this point in the history
  • Loading branch information
dvespasiano committed Jun 18, 2021
1 parent 5f085de commit 62d2ae2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
25 changes: 4 additions & 21 deletions single-tnc_col_527_item.php
Expand Up @@ -12,27 +12,8 @@
<div class="alinhamento-template-inventarios">
<div class="barra-lateral">
<?php echo tainacan_get_the_metadata();
$attachments = tainacan_get_the_attachments();
foreach ($attachments as $attachment) {
$media_items_thumbs[] =
tainacan_get_the_media_component_slide(array(
'media_content' => wp_get_attachment_image($attachment->ID, 'tainacan-medium', false),
'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image($attachment->ID, 'full', false) : ('<div class="attachment-without-image tainacan-embed-container"><iframe id="tainacan-attachment-iframe" src="' . tainacan_get_attachment_html_url($attachment->ID) . '"></iframe></div>'),
'media_title' => $attachment->post_title,
'media_description' => $attachment->post_content,
'media_caption' => $attachment->post_excerpt,
'media_type' => $attachment->post_mime_type
));
}
get_template_part('template-parts/get-attachments-tainacan');
?>
<span>anexos</span>
<div class="attachments">
<?php
foreach ($media_items_thumbs as $media) {
echo $media;
}
?>
</div>
</div>
<div class="post-inventario">
<h1 class="is-style-title-iphan-underscore">
Expand All @@ -44,7 +25,9 @@
<a type="button" class="plus-minus" data-toggle="collapse" data-target="#metadata-inventario" aria-controls="metadata-inventario" aria-expanded="false"></a>
</div>
<div id="metadata-inventario" class="collapse">
<?php echo tainacan_get_the_metadata(); ?>
<?php echo tainacan_get_the_metadata();
get_template_part('template-parts/get-attachments-tainacan');
?>
</div>
</div>
<div class="entry-content meta-content">
Expand Down
25 changes: 25 additions & 0 deletions template-parts/get-attachments-tainacan.php
@@ -0,0 +1,25 @@
<?php
$attachments = tainacan_get_the_attachments();
foreach ($attachments as $attachment) {
$media_items_thumbs[] =
tainacan_get_the_media_component_slide(array(
'media_content' => wp_get_attachment_image($attachment->ID, 'tainacan-medium', false),
'media_content_full' => wp_attachment_is('image', $attachment->ID) ? wp_get_attachment_image($attachment->ID, 'full', false) : ('<div class="attachment-without-image tainacan-embed-container"><iframe id="tainacan-attachment-iframe" src="' . tainacan_get_attachment_html_url($attachment->ID) . '"></iframe></div>'),
'media_title' => $attachment->post_title,
'media_description' => $attachment->post_content,
'media_caption' => $attachment->post_excerpt,
'media_type' => $attachment->post_mime_type
));
}
?>
<?php if (sizeof($attachments) > 0 && sizeof($media_items_thumbs) > 0) {
?>
<span>anexos</span>
<div class="attachments">
<?php
foreach ($media_items_thumbs as $media) {
echo $media;
}
?>
</div>
<?php } ?>

0 comments on commit 62d2ae2

Please sign in to comment.