@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_wrap_before(); ?> |
12 | 12 | |
13 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
13 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
14 | 14 | |
15 | 15 | <?php lsx_content_before(); ?> |
16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | <?php lsx_content_top(); ?> |
20 | 20 | |
21 | - <?php while ( have_posts() ) : the_post(); ?> |
|
21 | + <?php while (have_posts()) : the_post(); ?> |
|
22 | 22 | |
23 | 23 | <?php lsx_entry_before(); ?> |
24 | 24 | |
@@ -32,22 +32,22 @@ discard block |
||
32 | 32 | <div class="entry-meta"> |
33 | 33 | <?php |
34 | 34 | $metadata = wp_get_attachment_metadata(); |
35 | - printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', 'lsx' ), |
|
36 | - esc_attr( get_the_date( 'c' ) ), |
|
37 | - esc_html( get_the_date() ), |
|
35 | + printf(__('Published <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', 'lsx'), |
|
36 | + esc_attr(get_the_date('c')), |
|
37 | + esc_html(get_the_date()), |
|
38 | 38 | wp_get_attachment_url(), |
39 | 39 | $metadata['width'], |
40 | 40 | $metadata['height'], |
41 | - get_permalink( $post->post_parent ), |
|
42 | - get_the_title( $post->post_parent ) |
|
41 | + get_permalink($post->post_parent), |
|
42 | + get_the_title($post->post_parent) |
|
43 | 43 | ); |
44 | 44 | ?> |
45 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?> |
|
45 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="sep"> | </span> <span class="edit-link">', '</span>'); ?> |
|
46 | 46 | </div><!-- .entry-meta --> |
47 | 47 | |
48 | 48 | <nav id="image-navigation" class="site-navigation"> |
49 | - <span class="previous-image"><?php previous_image_link( false, '← '.esc_html__( 'Previous', 'lsx' ) ); ?></span> |
|
50 | - <span class="next-image"><?php next_image_link( false, esc_html__( 'Next', 'lsx' ).' →' ); ?></span> |
|
49 | + <span class="previous-image"><?php previous_image_link(false, '← ' . esc_html__('Previous', 'lsx')); ?></span> |
|
50 | + <span class="next-image"><?php next_image_link(false, esc_html__('Next', 'lsx') . ' →'); ?></span> |
|
51 | 51 | </nav><!-- #image-navigation --> |
52 | 52 | </header><!-- .entry-header --> |
53 | 53 | |
@@ -60,33 +60,33 @@ discard block |
||
60 | 60 | * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, |
61 | 61 | * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file |
62 | 62 | */ |
63 | - $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); |
|
64 | - foreach ( $attachments as $k => $attachment ) { |
|
65 | - if ( $attachment->ID == $post->ID ) |
|
63 | + $attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'))); |
|
64 | + foreach ($attachments as $k => $attachment) { |
|
65 | + if ($attachment->ID == $post->ID) |
|
66 | 66 | break; |
67 | 67 | } |
68 | 68 | $k++; |
69 | 69 | // If there is more than 1 attachment in a gallery |
70 | - if ( count( $attachments ) > 1 ) { |
|
71 | - if ( isset( $attachments[ $k ] ) ) |
|
70 | + if (count($attachments) > 1) { |
|
71 | + if (isset($attachments[$k])) |
|
72 | 72 | // get the URL of the next image attachment |
73 | - $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
|
73 | + $next_attachment_url = get_attachment_link($attachments[$k]->ID); |
|
74 | 74 | else |
75 | 75 | // or get the URL of the first image attachment |
76 | - $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
|
76 | + $next_attachment_url = get_attachment_link($attachments[0]->ID); |
|
77 | 77 | } else { |
78 | 78 | // or, if there's only 1 image, get the URL of the image |
79 | 79 | $next_attachment_url = wp_get_attachment_url(); |
80 | 80 | } |
81 | 81 | ?> |
82 | 82 | |
83 | - <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php |
|
84 | - $attachment_size = apply_filters( 'shape_attachment_size', array( 1200, 1200 ) ); // Filterable image size. |
|
85 | - echo wp_get_attachment_image( $post->ID, $attachment_size ); |
|
83 | + <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr(get_the_title()); ?>" rel="attachment"><?php |
|
84 | + $attachment_size = apply_filters('shape_attachment_size', array(1200, 1200)); // Filterable image size. |
|
85 | + echo wp_get_attachment_image($post->ID, $attachment_size); |
|
86 | 86 | ?></a> |
87 | 87 | </div><!-- .attachment --> |
88 | 88 | |
89 | - <?php if ( ! empty( $post->post_excerpt ) ) : ?> |
|
89 | + <?php if ( ! empty($post->post_excerpt)) : ?> |
|
90 | 90 | <div class="entry-caption"> |
91 | 91 | <?php the_excerpt(); ?> |
92 | 92 | </div><!-- .entry-caption --> |
@@ -96,27 +96,27 @@ discard block |
||
96 | 96 | <?php |
97 | 97 | the_content(); |
98 | 98 | |
99 | - wp_link_pages( array( |
|
99 | + wp_link_pages(array( |
|
100 | 100 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
101 | 101 | 'after' => '</div></div>', |
102 | 102 | 'link_before' => '<span>', |
103 | 103 | 'link_after' => '</span>' |
104 | - ) ); |
|
104 | + )); |
|
105 | 105 | ?> |
106 | 106 | |
107 | 107 | </div><!-- .entry-content --> |
108 | 108 | |
109 | 109 | <footer class="entry-meta"> |
110 | 110 | |
111 | - <?php if ( ! is_single() ) : ?> |
|
111 | + <?php if ( ! is_single()) : ?> |
|
112 | 112 | <a class="read-more" href="<?php the_permalink(); ?>">Read More</a> |
113 | 113 | <?php endif ?> |
114 | 114 | |
115 | - <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?> |
|
116 | - <span class="comments-link"><?php comments_popup_link( esc_html__( 'Leave a comment', 'lsx' ), esc_html__( '1 Comment', 'lsx' ), esc_html__( '% Comments', 'lsx' ) ); ?></span> |
|
115 | + <?php if ( ! post_password_required() && (comments_open() || '0' != get_comments_number())) : ?> |
|
116 | + <span class="comments-link"><?php comments_popup_link(esc_html__('Leave a comment', 'lsx'), esc_html__('1 Comment', 'lsx'), esc_html__('% Comments', 'lsx')); ?></span> |
|
117 | 117 | <?php endif; ?> |
118 | 118 | |
119 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="edit-link">', '</span>' ); ?> |
|
119 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="edit-link">', '</span>'); ?> |
|
120 | 120 | </footer><!-- .entry-meta --> |
121 | 121 | |
122 | 122 | <?php lsx_entry_bottom(); ?> |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | <?php |
127 | 127 | // If comments are open or we have at least one comment, load up the comment template |
128 | - if ( comments_open() || '0' != get_comments_number() ) : |
|
128 | + if (comments_open() || '0' != get_comments_number()) : |
|
129 | 129 | comments_template(); |
130 | 130 | endif; |
131 | 131 | ?> |