@@ -25,7 +25,7 @@ |
||
| 25 | 25 | if(has_nav_menu('footer-menu')){ |
| 26 | 26 | wp_nav_menu(array('theme_location' => 'footer-menu')); |
| 27 | 27 | } |
| 28 | - }else{ |
|
| 28 | + } else{ |
|
| 29 | 29 | if(has_nav_menu('footer_logged_in')){ |
| 30 | 30 | wp_nav_menu(array('theme_location' => 'footer_logged_in')); |
| 31 | 31 | } |
@@ -62,18 +62,20 @@ |
||
| 62 | 62 | */ |
| 63 | 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 | 64 | foreach ( $attachments as $k => $attachment ) { |
| 65 | - if ( $attachment->ID == $post->ID ) |
|
| 66 | - break; |
|
| 65 | + if ( $attachment->ID == $post->ID ) { |
|
| 66 | + break; |
|
| 67 | + } |
|
| 67 | 68 | } |
| 68 | 69 | $k++; |
| 69 | 70 | // If there is more than 1 attachment in a gallery |
| 70 | 71 | if ( count( $attachments ) > 1 ) { |
| 71 | - if ( isset( $attachments[ $k ] ) ) |
|
| 72 | - // get the URL of the next image attachment |
|
| 72 | + if ( isset( $attachments[ $k ] ) ) { |
|
| 73 | + // get the URL of the next image attachment |
|
| 73 | 74 | $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
| 74 | - else |
|
| 75 | - // or get the URL of the first image attachment |
|
| 75 | + } else { |
|
| 76 | + // or get the URL of the first image attachment |
|
| 76 | 77 | $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
| 78 | + } |
|
| 77 | 79 | } else { |
| 78 | 80 | // or, if there's only 1 image, get the URL of the image |
| 79 | 81 | $next_attachment_url = wp_get_attachment_url(); |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | $show_on_front = get_option('show_on_front','posts'); |
| 34 | 34 | if('page' == $show_on_front){ |
| 35 | 35 | $archive_link = get_permalink(get_option('page_for_posts')); |
| 36 | - }else{ |
|
| 36 | + } else{ |
|
| 37 | 37 | $archive_link = home_url(); |
| 38 | 38 | } |
| 39 | - }else{ |
|
| 39 | + } else{ |
|
| 40 | 40 | $archive_link = get_post_format_link($format); |
| 41 | 41 | } |
| 42 | 42 | $format = lsx_translate_format_to_fontawesome($format); |
@@ -71,10 +71,12 @@ discard block |
||
| 71 | 71 | </div><!-- .entry-summary --> |
| 72 | 72 | <?php elseif ( has_post_format( array('link') ) ) : ?> |
| 73 | 73 | |
| 74 | - <?php else : ?> |
|
| 74 | + <?php else { |
|
| 75 | + : ?> |
|
| 75 | 76 | <div class="entry-content"> |
| 76 | 77 | <?php |
| 77 | 78 | the_content(); |
| 79 | +} |
|
| 78 | 80 | |
| 79 | 81 | wp_link_pages( array( |
| 80 | 82 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | class lsx_bootstrap_navwalker extends Walker_Nav_Menu { |
| 5 | 8 | |
@@ -71,14 +74,17 @@ discard block |
||
| 71 | 74 | |
| 72 | 75 | $class_names = join( ' ', $classes ); |
| 73 | 76 | |
| 74 | - if ( $args->has_children ) |
|
| 75 | - $class_names .= ' dropdown'; |
|
| 77 | + if ( $args->has_children ) { |
|
| 78 | + $class_names .= ' dropdown'; |
|
| 79 | + } |
|
| 76 | 80 | |
| 77 | - if ( in_array( 'current-menu-item', $classes ) ) |
|
| 78 | - $class_names .= ' active'; |
|
| 81 | + if ( in_array( 'current-menu-item', $classes ) ) { |
|
| 82 | + $class_names .= ' active'; |
|
| 83 | + } |
|
| 79 | 84 | |
| 80 | - if ( in_array( 'current-menu-parent', $classes ) ) |
|
| 81 | - $class_names .= ' active'; |
|
| 85 | + if ( in_array( 'current-menu-parent', $classes ) ) { |
|
| 86 | + $class_names .= ' active'; |
|
| 87 | + } |
|
| 82 | 88 | |
| 83 | 89 | //Check if this is ment to be a "social" type menu |
| 84 | 90 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
@@ -159,14 +165,16 @@ discard block |
||
| 159 | 165 | * @return null Null on failure with no changes to parameters. |
| 160 | 166 | */ |
| 161 | 167 | public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
| 162 | - if ( ! $element ) |
|
| 163 | - return; |
|
| 168 | + if ( ! $element ) { |
|
| 169 | + return; |
|
| 170 | + } |
|
| 164 | 171 | |
| 165 | 172 | $id_field = $this->db_fields['id']; |
| 166 | 173 | |
| 167 | 174 | // Display this element. |
| 168 | - if ( is_object( $args[0] ) ) |
|
| 169 | - $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 175 | + if ( is_object( $args[0] ) ) { |
|
| 176 | + $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 177 | + } |
|
| 170 | 178 | |
| 171 | 179 | parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
| 172 | 180 | } |
@@ -192,29 +200,34 @@ discard block |
||
| 192 | 200 | if ( $container ) { |
| 193 | 201 | $fb_output = '<' . $container; |
| 194 | 202 | |
| 195 | - if ( $container_id ) |
|
| 196 | - $fb_output .= ' id="' . $container_id . '"'; |
|
| 203 | + if ( $container_id ) { |
|
| 204 | + $fb_output .= ' id="' . $container_id . '"'; |
|
| 205 | + } |
|
| 197 | 206 | |
| 198 | - if ( $container_class ) |
|
| 199 | - $fb_output .= ' class="' . $container_class . '"'; |
|
| 207 | + if ( $container_class ) { |
|
| 208 | + $fb_output .= ' class="' . $container_class . '"'; |
|
| 209 | + } |
|
| 200 | 210 | |
| 201 | 211 | $fb_output .= '>'; |
| 202 | 212 | } |
| 203 | 213 | |
| 204 | 214 | $fb_output .= '<ul'; |
| 205 | 215 | |
| 206 | - if ( $menu_id ) |
|
| 207 | - $fb_output .= ' id="' . $menu_id . '"'; |
|
| 216 | + if ( $menu_id ) { |
|
| 217 | + $fb_output .= ' id="' . $menu_id . '"'; |
|
| 218 | + } |
|
| 208 | 219 | |
| 209 | - if ( $menu_class ) |
|
| 210 | - $fb_output .= ' class="' . $menu_class . '"'; |
|
| 220 | + if ( $menu_class ) { |
|
| 221 | + $fb_output .= ' class="' . $menu_class . '"'; |
|
| 222 | + } |
|
| 211 | 223 | |
| 212 | 224 | $fb_output .= '>'; |
| 213 | 225 | $fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">'.__('Add a menu','lsx').'</a></li>'; |
| 214 | 226 | $fb_output .= '</ul>'; |
| 215 | 227 | |
| 216 | - if ( $container ) |
|
| 217 | - $fb_output .= '</' . $container . '>'; |
|
| 228 | + if ( $container ) { |
|
| 229 | + $fb_output .= '</' . $container . '>'; |
|
| 230 | + } |
|
| 218 | 231 | |
| 219 | 232 | echo $fb_output; |
| 220 | 233 | } |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Theme Configuration File |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Layout hooks |
@@ -62,7 +65,7 @@ discard block |
||
| 62 | 65 | $show_on_front = get_option('show_on_front'); |
| 63 | 66 | if('page' == $show_on_front){ |
| 64 | 67 | return lsx_layout_selector( 'main', 'home' ); |
| 65 | - }else{ |
|
| 68 | + } else{ |
|
| 66 | 69 | return lsx_layout_selector( 'main', 'site' ); |
| 67 | 70 | } |
| 68 | 71 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * LSX_Customize_Font_Control Class |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -221,13 +221,15 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | |
| 223 | 223 | if ( (!isset( $_POST['lsx_website_nonce'] ) || !wp_verify_nonce( $_POST['lsx_website_nonce'], basename( __FILE__ ) )) |
| 224 | - || (!isset( $_POST['lsx_client_nonce'] ) || !wp_verify_nonce( $_POST['lsx_client_nonce'], basename( __FILE__ ) )) ) |
|
| 225 | - return $post_id; |
|
| 224 | + || (!isset( $_POST['lsx_client_nonce'] ) || !wp_verify_nonce( $_POST['lsx_client_nonce'], basename( __FILE__ ) )) ) { |
|
| 225 | + return $post_id; |
|
| 226 | + } |
|
| 226 | 227 | |
| 227 | 228 | $post_type = get_post_type_object( $post->post_type ); |
| 228 | 229 | |
| 229 | - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) |
|
| 230 | - return $post_id; |
|
| 230 | + if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) { |
|
| 231 | + return $post_id; |
|
| 232 | + } |
|
| 231 | 233 | |
| 232 | 234 | |
| 233 | 235 | $meta_keys = array('lsx-website','lsx-client'); |
@@ -238,14 +240,13 @@ discard block |
||
| 238 | 240 | |
| 239 | 241 | $meta_value = get_post_meta( $post_id, $meta_key, true ); |
| 240 | 242 | |
| 241 | - if ( $new_meta_value && '' == $meta_value ) |
|
| 242 | - add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
| 243 | - |
|
| 244 | - elseif ( $new_meta_value && $new_meta_value != $meta_value ) |
|
| 245 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
| 246 | - |
|
| 247 | - elseif ( '' == $new_meta_value && $meta_value ) |
|
| 248 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
| 243 | + if ( $new_meta_value && '' == $meta_value ) { |
|
| 244 | + add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
| 245 | + } elseif ( $new_meta_value && $new_meta_value != $meta_value ) { |
|
| 246 | + update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
| 247 | + } elseif ( '' == $new_meta_value && $meta_value ) { |
|
| 248 | + delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
| 249 | + } |
|
| 249 | 250 | |
| 250 | 251 | } |
| 251 | 252 | } |
@@ -398,7 +399,7 @@ discard block |
||
| 398 | 399 | |
| 399 | 400 | if('jetpack-portfolio' == get_post_type()){ |
| 400 | 401 | get_template_part( 'content', 'portfolio' ); |
| 401 | - }else{ |
|
| 402 | + } else{ |
|
| 402 | 403 | get_template_part( 'content', get_post_type() ); |
| 403 | 404 | } |
| 404 | 405 | } |