@@ -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,25 +32,25 @@ discard block |
||
32 | 32 | <div class="entry-meta"> |
33 | 33 | <?php |
34 | 34 | $metadata = wp_get_attachment_metadata(); |
35 | - printf( wp_kses_post( '%1$s <span class="entry-date"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></span> %4$s <a href="%5$s">%6$s × %7$s</a> %8$s <a href="%9$s" title="%10$s" rel="gallery">%10$s</a>' ), |
|
36 | - esc_html__( 'Published', 'lsx' ), |
|
37 | - esc_attr( get_the_date( 'c' ) ), |
|
38 | - esc_html( get_the_date() ), |
|
39 | - esc_html__( 'at', 'lsx' ), |
|
40 | - esc_url( wp_get_attachment_url() ), |
|
41 | - esc_attr( $metadata['width'] ), |
|
42 | - esc_attr( $metadata['height'] ), |
|
43 | - esc_html__( 'in', 'lsx' ), |
|
44 | - esc_url( get_permalink( $post->post_parent ) ), |
|
45 | - get_the_title( $post->post_parent ) |
|
35 | + printf(wp_kses_post('%1$s <span class="entry-date"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></span> %4$s <a href="%5$s">%6$s × %7$s</a> %8$s <a href="%9$s" title="%10$s" rel="gallery">%10$s</a>'), |
|
36 | + esc_html__('Published', 'lsx'), |
|
37 | + esc_attr(get_the_date('c')), |
|
38 | + esc_html(get_the_date()), |
|
39 | + esc_html__('at', 'lsx'), |
|
40 | + esc_url(wp_get_attachment_url()), |
|
41 | + esc_attr($metadata['width']), |
|
42 | + esc_attr($metadata['height']), |
|
43 | + esc_html__('in', 'lsx'), |
|
44 | + esc_url(get_permalink($post->post_parent)), |
|
45 | + get_the_title($post->post_parent) |
|
46 | 46 | ); |
47 | 47 | ?> |
48 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?> |
|
48 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="sep"> | </span> <span class="edit-link">', '</span>'); ?> |
|
49 | 49 | </div><!-- .entry-meta --> |
50 | 50 | |
51 | 51 | <nav id="image-navigation" class="site-navigation"> |
52 | - <span class="previous-image"><?php previous_image_link( false, '← '.esc_html__( 'Previous', 'lsx' ) ); ?></span> |
|
53 | - <span class="next-image"><?php next_image_link( false, esc_html__( 'Next', 'lsx' ).' →' ); ?></span> |
|
52 | + <span class="previous-image"><?php previous_image_link(false, '← ' . esc_html__('Previous', 'lsx')); ?></span> |
|
53 | + <span class="next-image"><?php next_image_link(false, esc_html__('Next', 'lsx') . ' →'); ?></span> |
|
54 | 54 | </nav><!-- #image-navigation --> |
55 | 55 | </header><!-- .entry-header --> |
56 | 56 | |
@@ -63,33 +63,33 @@ discard block |
||
63 | 63 | * 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, |
64 | 64 | * 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 |
65 | 65 | */ |
66 | - $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' ) ) ); |
|
67 | - foreach ( $attachments as $k => $attachment ) { |
|
68 | - if ( $attachment->ID == $post->ID ) |
|
66 | + $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'))); |
|
67 | + foreach ($attachments as $k => $attachment) { |
|
68 | + if ($attachment->ID == $post->ID) |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 | $k++; |
72 | 72 | // If there is more than 1 attachment in a gallery |
73 | - if ( count( $attachments ) > 1 ) { |
|
74 | - if ( isset( $attachments[ $k ] ) ) |
|
73 | + if (count($attachments) > 1) { |
|
74 | + if (isset($attachments[$k])) |
|
75 | 75 | // get the URL of the next image attachment |
76 | - $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
|
76 | + $next_attachment_url = get_attachment_link($attachments[$k]->ID); |
|
77 | 77 | else |
78 | 78 | // or get the URL of the first image attachment |
79 | - $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
|
79 | + $next_attachment_url = get_attachment_link($attachments[0]->ID); |
|
80 | 80 | } else { |
81 | 81 | // or, if there's only 1 image, get the URL of the image |
82 | 82 | $next_attachment_url = wp_get_attachment_url(); |
83 | 83 | } |
84 | 84 | ?> |
85 | 85 | |
86 | - <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php |
|
87 | - $attachment_size = apply_filters( 'shape_attachment_size', array( 1200, 1200 ) ); // Filterable image size. |
|
88 | - echo wp_get_attachment_image( $post->ID, $attachment_size ); |
|
86 | + <a href="<?php echo esc_url($next_attachment_url); ?>" title="<?php echo esc_attr(get_the_title()); ?>" rel="attachment"><?php |
|
87 | + $attachment_size = apply_filters('shape_attachment_size', array(1200, 1200)); // Filterable image size. |
|
88 | + echo wp_get_attachment_image($post->ID, $attachment_size); |
|
89 | 89 | ?></a> |
90 | 90 | </div><!-- .attachment --> |
91 | 91 | |
92 | - <?php if ( ! empty( $post->post_excerpt ) ) : ?> |
|
92 | + <?php if ( ! empty($post->post_excerpt)) : ?> |
|
93 | 93 | <div class="entry-caption"> |
94 | 94 | <?php the_excerpt(); ?> |
95 | 95 | </div><!-- .entry-caption --> |
@@ -99,27 +99,27 @@ discard block |
||
99 | 99 | <?php |
100 | 100 | the_content(); |
101 | 101 | |
102 | - wp_link_pages( array( |
|
102 | + wp_link_pages(array( |
|
103 | 103 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
104 | 104 | 'after' => '</div></div>', |
105 | 105 | 'link_before' => '<span>', |
106 | 106 | 'link_after' => '</span>' |
107 | - ) ); |
|
107 | + )); |
|
108 | 108 | ?> |
109 | 109 | |
110 | 110 | </div><!-- .entry-content --> |
111 | 111 | |
112 | 112 | <footer class="entry-meta"> |
113 | 113 | |
114 | - <?php if ( ! is_single() ) : ?> |
|
114 | + <?php if ( ! is_single()) : ?> |
|
115 | 115 | <a class="read-more" href="<?php the_permalink(); ?>">Read More</a> |
116 | 116 | <?php endif ?> |
117 | 117 | |
118 | - <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?> |
|
119 | - <span class="comments-link"><?php comments_popup_link( esc_html__( 'Leave a comment', 'lsx' ), esc_html__( '1 Comment', 'lsx' ), esc_html__( '% Comments', 'lsx' ) ); ?></span> |
|
118 | + <?php if ( ! post_password_required() && (comments_open() || '0' != get_comments_number())) : ?> |
|
119 | + <span class="comments-link"><?php comments_popup_link(esc_html__('Leave a comment', 'lsx'), esc_html__('1 Comment', 'lsx'), esc_html__('% Comments', 'lsx')); ?></span> |
|
120 | 120 | <?php endif; ?> |
121 | 121 | |
122 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="edit-link">', '</span>' ); ?> |
|
122 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="edit-link">', '</span>'); ?> |
|
123 | 123 | </footer><!-- .entry-meta --> |
124 | 124 | |
125 | 125 | <?php lsx_entry_bottom(); ?> |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | <?php |
130 | 130 | // If comments are open or we have at least one comment, load up the comment template |
131 | - if ( comments_open() || '0' != get_comments_number() ) : |
|
131 | + if (comments_open() || '0' != get_comments_number()) : |
|
132 | 132 | comments_template(); |
133 | 133 | endif; |
134 | 134 | ?> |