-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsidebar-gallery.php
93 lines (76 loc) · 3.85 KB
/
sidebar-gallery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* Gallery Sidebar
*
* Displays on the image page after clicking on a gallery image
*
* @package responsive_mobile
* @license license.txt
* @copyright 2014 CyberChimps Inc
* @since 0.0.1
*
* Please do not edit this file. This file is part of the responsive_mobile Framework and all modifications
* should be made in a child theme.
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
responsive_mobile_widgets_before(); // above widgets container hook
?>
<div id="widgets" class="widget-area gallery-sidebar" role="complementary" itemscope="itemscope"
itemtype="http://schema.org/WPSideBar">
<?php responsive_mobile_widgets(); // above widgets hook ?>
<aside class="widget-wrapper">
<h3 class="widget-title"><?php _e( 'Image Information', 'responsive-mobile' ); ?></h3>
<ul>
<?php $responsive_mobile_data = get_post_meta( $post->ID, '_wp_attachment_metadata', true ); ?>
<?php if ( is_array( $responsive_mobile_data ) ) : ?>
<span class="full-size"><?php _e( 'Full Size:', 'responsive-mobile' ); ?> <a href="<?php echo esc_url( wp_get_attachment_url( $post->ID ) ); ?>"><?php echo absint( $responsive_mobile_data['width'] ) . '×' . absint( $responsive_mobile_data['height'] ); ?></a>px</span>
<?php if ( is_array( $responsive_mobile_data['image_meta'] ) ) : ?>
<?php if ( $responsive_mobile_data['image_meta']['aperture'] ) : ?>
<span class="aperture"><?php _e( 'Aperture: f/', 'responsive-mobile' ); ?><?php echo esc_html( $responsive_mobile_data['image_meta']['aperture'] ); ?></span>
<?php endif; ?>
<?php if ( $responsive_mobile_data['image_meta']['focal_length'] ) : ?>
<span
class="focal-length"><?php _e( 'Focal Length:', 'responsive-mobile' ); ?> <?php echo esc_html( $responsive_mobile_data['image_meta']['focal_length'] ); ?><?php _e( 'mm', 'responsive-mobile' ); ?></span>
<?php endif; ?>
<?php if ( $responsive_mobile_data['image_meta']['iso'] ) : ?>
<span class="iso"><?php _e( 'ISO:', 'responsive-mobile' ); ?> <?php echo esc_html( $responsive_mobile_data['image_meta']['iso'] ); ?></span>
<?php endif; ?>
<?php if ( $responsive_mobile_data['image_meta']['shutter_speed'] ) : ?>
<span class="shutter"><?php _e( 'Shutter:', 'responsive-mobile' ); ?>
<?php if ( ( 1 / $responsive_mobile_data['image_meta']['shutter_speed'] ) > 1 ) {
echo "1/";
if ( number_format( ( 1 / $responsive_mobile_data['image_meta']['shutter_speed'] ), 1 ) == number_format( ( 1 / $responsive_mobile_data['image_meta']['shutter_speed'] ), 0 ) ) {
echo number_format( ( 1 / $responsive_mobile_data['image_meta']['shutter_speed'] ), 0, '.', '' ) . ' sec';
} else {
echo number_format( ( 1 / $responsive_mobile_data['image_meta']['shutter_speed'] ), 1, '.', '' ) . ' sec';
}
} else {
echo esc_html( $responsive_mobile_data['image_meta']['shutter_speed'] ) . ' sec';
} ?>
</span>
<?php endif; ?>
<?php if ( $responsive_mobile_data['image_meta']['camera'] ) : ?>
<span class="camera"><?php _e( 'Camera:', 'responsive-mobile' ); ?> <?php echo esc_html( $responsive_mobile_data['image_meta']['camera'] ); ?></span>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</ul>
</aside>
<!-- .widget-wrapper -->
</div>
<!-- #widgets -->
<?php if ( ! is_active_sidebar( 'gallery-widget' ) ) {
return;
} ?>
<?php if ( is_active_sidebar( 'gallery-widget' ) ) : ?>
<div id="widgets" class="widget-area" role="complementary">
<?php responsive_mobile_widgets(); // above widgets hook ?>
<?php dynamic_sidebar( 'gallery-widget' ); ?>
<?php responsive_mobile_widgets_end(); // after widgets hook ?>
</div>
<!-- end of #widgets -->
<?php responsive_mobile_widgets_after(); // after widgets container hook ?>
<?php endif; ?>