Adds option to hide attachments label on items single page.

This commit is contained in:
mateuswetah 2020-05-05 10:39:25 -03:00
parent aab69251e5
commit 53a43114a5
2 changed files with 21 additions and 4 deletions

View File

@ -414,7 +414,24 @@ function tainacan_customize_register( $wp_customize ) {
) );
/**
* Adds options to display item autohr and publish date.
* Adds options to hide attachments file names on carousel.
*/
$wp_customize->add_setting( 'tainacan_single_item_hide_files_name', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => false,
'transport' => 'refresh'
) );
$wp_customize->add_control( 'tainacan_single_item_hide_files_name', array(
'type' => 'checkbox',
'priority' => 3, // Within the section.
'section' => 'tainacan_single_item_page',
'label' => __( 'Hide the attchments label', 'tainacan-interface' ),
'description' => __( 'Toggle to not display the document and attachments name below its thumbnail.', 'tainacan-interface' )
) );
/**
* Adds options to display item author and publish date.
*/
$wp_customize->add_setting( 'tainacan_single_item_hide_item_meta', array(
'type' => 'theme_mod',

View File

@ -67,8 +67,8 @@
<?php
the_post_thumbnail('tainacan-medium-full', array('class' => 'item-card--thumbnail mt-2'));
echo '<br>';
echo __( 'Document', 'tainacan-interface' );
?>
<span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo __( 'Document', 'tainacan-interface' ); ?></span>
</div>
<?php endif; ?>
<?php foreach ( $attachments as $attachment ) { ?>
@ -77,8 +77,8 @@
<?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true );
echo '<br>';
echo get_the_title( $attachment->ID );
?>
<span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span>
</div>
</div>
<?php } ?>
@ -103,8 +103,8 @@
<?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true );
echo '<br>';
echo get_the_title( $attachment->ID );
?>
<span class="single-item-file-name <?php if (get_theme_mod('tainacan_single_item_hide_files_name', false)) echo 'sr-only' ?>"><?php echo get_the_title( $attachment->ID ); ?></span>
</a>
</div>
<?php }