@@ -11,27 +11,27 @@ |
||
| 11 | 11 | * @param array $classes Classes for the body element. |
| 12 | 12 | * @return array |
| 13 | 13 | */ |
| 14 | -function designfly_body_classes( $classes ) { |
|
| 14 | +function designfly_body_classes($classes) { |
|
| 15 | 15 | // Adds a class of hfeed to non-singular pages. |
| 16 | - if ( ! is_singular() ) { |
|
| 16 | + if ( ! is_singular()) { |
|
| 17 | 17 | $classes[] = 'hfeed'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // Adds a class of no-sidebar when there is no sidebar present. |
| 21 | - if ( ! is_active_sidebar( 'sidebar-1' ) ) { |
|
| 21 | + if ( ! is_active_sidebar('sidebar-1')) { |
|
| 22 | 22 | $classes[] = 'no-sidebar'; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | return $classes; |
| 26 | 26 | } |
| 27 | -add_filter( 'body_class', 'designfly_body_classes' ); |
|
| 27 | +add_filter('body_class', 'designfly_body_classes'); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Add a pingback url auto-discovery header for single posts, pages, or attachments. |
| 31 | 31 | */ |
| 32 | 32 | function designfly_pingback_header() { |
| 33 | - if ( is_singular() && pings_open() ) { |
|
| 34 | - printf( '<link rel="pingback" href="%s">', esc_url( get_bloginfo( 'pingback_url' ) ) ); |
|
| 33 | + if (is_singular() && pings_open()) { |
|
| 34 | + printf('<link rel="pingback" href="%s">', esc_url(get_bloginfo('pingback_url'))); |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | -add_action( 'wp_head', 'designfly_pingback_header' ); |
|
| 37 | +add_action('wp_head', 'designfly_pingback_header'); |
|
@@ -154,16 +154,16 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | function designfly_pagination_bar( $custom_query ) { |
| 156 | 156 | |
| 157 | - $total_pages = $custom_query->max_num_pages; |
|
| 158 | - $big = 999999999; // need an unlikely integer |
|
| 157 | + $total_pages = $custom_query->max_num_pages; |
|
| 158 | + $big = 999999999; // need an unlikely integer |
|
| 159 | 159 | |
| 160 | - if ( $total_pages > 1 ) { |
|
| 161 | - $current_page = max(1, get_query_var('paged')); |
|
| 160 | + if ( $total_pages > 1 ) { |
|
| 161 | + $current_page = max(1, get_query_var('paged')); |
|
| 162 | 162 | |
| 163 | - $pages = paginate_links(array( |
|
| 164 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 165 | - 'format' => '?paged=%#%', |
|
| 166 | - 'current' => $current_page, |
|
| 163 | + $pages = paginate_links(array( |
|
| 164 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 165 | + 'format' => '?paged=%#%', |
|
| 166 | + 'current' => $current_page, |
|
| 167 | 167 | 'total' => $total_pages, |
| 168 | 168 | 'type' => 'array', |
| 169 | 169 | 'prev_text' => '<img class="pagination-arrow-left" src="' . get_template_directory_uri() . '/assets/images/pagination-arrow.png' . '" />', |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | echo '</div>'; |
| 181 | 181 | } |
| 182 | - } |
|
| 182 | + } |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | function designfly_custom_comments($comment, $args, $depth) { |
| 193 | 193 | |
| 194 | - if ( 'div' === $args['style'] ) { |
|
| 195 | - $tag = 'div'; |
|
| 196 | - $add_below = 'comment'; |
|
| 197 | - } else { |
|
| 198 | - $tag = 'li'; |
|
| 199 | - $add_below = 'div-comment'; |
|
| 200 | - } |
|
| 194 | + if ( 'div' === $args['style'] ) { |
|
| 195 | + $tag = 'div'; |
|
| 196 | + $add_below = 'comment'; |
|
| 197 | + } else { |
|
| 198 | + $tag = 'li'; |
|
| 199 | + $add_below = 'div-comment'; |
|
| 200 | + } |
|
| 201 | 201 | ?> |
| 202 | 202 | |
| 203 | 203 | <<?php echo $tag ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ) ?> id="comment-<?php comment_ID() ?>"> |
@@ -7,27 +7,27 @@ discard block |
||
| 7 | 7 | * @package DesignFly |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! function_exists( 'designfly_posted_on' ) ) : |
|
| 10 | +if ( ! function_exists('designfly_posted_on')) : |
|
| 11 | 11 | /** |
| 12 | 12 | * Prints HTML with meta information for the current post-date/time. |
| 13 | 13 | */ |
| 14 | 14 | function designfly_posted_on() { |
| 15 | 15 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
| 16 | - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { |
|
| 16 | + if (get_the_time('U') !== get_the_modified_time('U')) { |
|
| 17 | 17 | $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - $time_string = sprintf( $time_string, |
|
| 21 | - esc_attr( get_the_date( DATE_W3C ) ), |
|
| 22 | - esc_html( get_the_date() ), |
|
| 23 | - esc_attr( get_the_modified_date( DATE_W3C ) ), |
|
| 24 | - esc_html( get_the_modified_date() ) |
|
| 20 | + $time_string = sprintf($time_string, |
|
| 21 | + esc_attr(get_the_date(DATE_W3C)), |
|
| 22 | + esc_html(get_the_date()), |
|
| 23 | + esc_attr(get_the_modified_date(DATE_W3C)), |
|
| 24 | + esc_html(get_the_modified_date()) |
|
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | 27 | $posted_on = sprintf( |
| 28 | 28 | /* translators: %s: post date. */ |
| 29 | - esc_html_x( ' on %s', 'post date', 'designfly' ), |
|
| 30 | - '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' |
|
| 29 | + esc_html_x(' on %s', 'post date', 'designfly'), |
|
| 30 | + '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>' |
|
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | 33 | echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK. |
@@ -35,15 +35,15 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | endif; |
| 37 | 37 | |
| 38 | -if ( ! function_exists( 'designfly_posted_by' ) ) : |
|
| 38 | +if ( ! function_exists('designfly_posted_by')) : |
|
| 39 | 39 | /** |
| 40 | 40 | * Prints HTML with meta information for the current author. |
| 41 | 41 | */ |
| 42 | 42 | function designfly_posted_by() { |
| 43 | 43 | $byline = sprintf( |
| 44 | 44 | /* translators: %s: post author. */ |
| 45 | - esc_html_x( 'by %s', 'post author', 'designfly' ), |
|
| 46 | - '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' |
|
| 45 | + esc_html_x('by %s', 'post author', 'designfly'), |
|
| 46 | + '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>' |
|
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | echo '<span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. |
@@ -51,35 +51,35 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | endif; |
| 53 | 53 | |
| 54 | -if ( ! function_exists( 'designfly_entry_footer' ) ) : |
|
| 54 | +if ( ! function_exists('designfly_entry_footer')) : |
|
| 55 | 55 | /** |
| 56 | 56 | * Prints HTML with meta information for the categories, tags and comments. |
| 57 | 57 | */ |
| 58 | 58 | function designfly_entry_footer() { |
| 59 | 59 | // Hide category and tag text for pages. |
| 60 | - if ( 'post' === get_post_type() ) { |
|
| 60 | + if ('post' === get_post_type()) { |
|
| 61 | 61 | /* translators: used between list items, there is a space after the comma */ |
| 62 | - $categories_list = get_the_category_list( esc_html__( ', ', 'designfly' ) ); |
|
| 63 | - if ( $categories_list ) { |
|
| 62 | + $categories_list = get_the_category_list(esc_html__(', ', 'designfly')); |
|
| 63 | + if ($categories_list) { |
|
| 64 | 64 | /* translators: 1: list of categories. */ |
| 65 | - printf( '<span class="cat-links">' . esc_html__( 'Posted in: %1$s', 'designfly' ) . '</span>', $categories_list ); // WPCS: XSS OK. |
|
| 65 | + printf('<span class="cat-links">' . esc_html__('Posted in: %1$s', 'designfly') . '</span>', $categories_list); // WPCS: XSS OK. |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /* translators: used between list items, there is a space after the comma */ |
| 69 | - $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'designfly' ) ); |
|
| 70 | - if ( $tags_list ) { |
|
| 69 | + $tags_list = get_the_tag_list('', esc_html_x(', ', 'list item separator', 'designfly')); |
|
| 70 | + if ($tags_list) { |
|
| 71 | 71 | /* translators: 1: list of tags. */ |
| 72 | - printf( '<span class="tags-links">' . esc_html__( 'TAGS: %1$s', 'designfly' ) . '</span>', $tags_list ); // WPCS: XSS OK. |
|
| 72 | + printf('<span class="tags-links">' . esc_html__('TAGS: %1$s', 'designfly') . '</span>', $tags_list); // WPCS: XSS OK. |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { |
|
| 76 | + if ( ! is_single() && ! post_password_required() && (comments_open() || get_comments_number())) { |
|
| 77 | 77 | echo '<span class="comments-link">'; |
| 78 | 78 | comments_popup_link( |
| 79 | 79 | sprintf( |
| 80 | 80 | wp_kses( |
| 81 | 81 | /* translators: %s: post title */ |
| 82 | - __( 'Leave a Comment<span class="screen-reader-text"> on %s</span>', 'designfly' ), |
|
| 82 | + __('Leave a Comment<span class="screen-reader-text"> on %s</span>', 'designfly'), |
|
| 83 | 83 | array( |
| 84 | 84 | 'span' => array( |
| 85 | 85 | 'class' => array(), |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | endif; |
| 112 | 112 | |
| 113 | -if ( ! function_exists( 'designfly_post_thumbnail' ) ) : |
|
| 113 | +if ( ! function_exists('designfly_post_thumbnail')) : |
|
| 114 | 114 | /** |
| 115 | 115 | * Displays an optional post thumbnail. |
| 116 | 116 | * |
@@ -118,11 +118,11 @@ discard block |
||
| 118 | 118 | * element when on single views. |
| 119 | 119 | */ |
| 120 | 120 | function designfly_post_thumbnail() { |
| 121 | - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { |
|
| 121 | + if (post_password_required() || is_attachment() || ! has_post_thumbnail()) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if ( is_singular() ) : |
|
| 125 | + if (is_singular()) : |
|
| 126 | 126 | ?> |
| 127 | 127 | |
| 128 | 128 | <div class="post-thumbnail"> |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | <?php else : ?> |
| 133 | 133 | <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> |
| 134 | 134 | <?php |
| 135 | - the_post_thumbnail( 'post-thumbnail', array( |
|
| 136 | - 'alt' => the_title_attribute( array( |
|
| 135 | + the_post_thumbnail('post-thumbnail', array( |
|
| 136 | + 'alt' => the_title_attribute(array( |
|
| 137 | 137 | 'echo' => false, |
| 138 | - ) ), |
|
| 139 | - ) ); |
|
| 138 | + )), |
|
| 139 | + )); |
|
| 140 | 140 | ?> |
| 141 | 141 | </a> |
| 142 | 142 | |
@@ -152,16 +152,16 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @param $custom_query requires the query object to get pagination |
| 154 | 154 | */ |
| 155 | -function designfly_pagination_bar( $custom_query ) { |
|
| 155 | +function designfly_pagination_bar($custom_query) { |
|
| 156 | 156 | |
| 157 | 157 | $total_pages = $custom_query->max_num_pages; |
| 158 | 158 | $big = 999999999; // need an unlikely integer |
| 159 | 159 | |
| 160 | - if ( $total_pages > 1 ) { |
|
| 160 | + if ($total_pages > 1) { |
|
| 161 | 161 | $current_page = max(1, get_query_var('paged')); |
| 162 | 162 | |
| 163 | - $pages = paginate_links(array( |
|
| 164 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 163 | + $pages = paginate_links(array( |
|
| 164 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
| 165 | 165 | 'format' => '?paged=%#%', |
| 166 | 166 | 'current' => $current_page, |
| 167 | 167 | 'total' => $total_pages, |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | )); |
| 172 | 172 | |
| 173 | 173 | /* for echoing out with custom html tags */ |
| 174 | - if( is_array( $pages ) ) { |
|
| 175 | - $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); |
|
| 174 | + if (is_array($pages)) { |
|
| 175 | + $paged = (get_query_var('paged') == 0) ? 1 : get_query_var('paged'); |
|
| 176 | 176 | echo '<div id="pagination">'; |
| 177 | - foreach ( $pages as $page ) { |
|
| 177 | + foreach ($pages as $page) { |
|
| 178 | 178 | echo $page; |
| 179 | 179 | } |
| 180 | 180 | echo '</div>'; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | function designfly_custom_comments($comment, $args, $depth) { |
| 193 | 193 | |
| 194 | - if ( 'div' === $args['style'] ) { |
|
| 194 | + if ('div' === $args['style']) { |
|
| 195 | 195 | $tag = 'div'; |
| 196 | 196 | $add_below = 'comment'; |
| 197 | 197 | } else { |
@@ -200,24 +200,24 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | ?> |
| 202 | 202 | |
| 203 | - <<?php echo $tag ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ) ?> id="comment-<?php comment_ID() ?>"> |
|
| 204 | - <?php if ( 'div' != $args['style'] ) : ?> |
|
| 203 | + <<?php echo $tag ?> <?php comment_class(empty($args['has_children']) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>"> |
|
| 204 | + <?php if ('div' != $args['style']) : ?> |
|
| 205 | 205 | <div id="div-comment-<?php comment_ID() ?>" class="comment-body"> |
| 206 | 206 | <?php endif; ?> |
| 207 | 207 | |
| 208 | 208 | <div class="comment-author vcard"> |
| 209 | - <?php printf( __( '<cite class="fn">%s</cite> <span class="says">said on </span>' ), get_comment_author_link() ); ?> |
|
| 209 | + <?php printf(__('<cite class="fn">%s</cite> <span class="says">said on </span>'), get_comment_author_link()); ?> |
|
| 210 | 210 | </div> |
| 211 | 211 | |
| 212 | - <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ); ?>"> |
|
| 212 | + <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"> |
|
| 213 | 213 | <?php |
| 214 | 214 | /* translators: 1: date, 2: time */ |
| 215 | - printf( __('%1$s at %2$s'), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)' ), ' ', '' ); |
|
| 215 | + printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()); ?></a><?php edit_comment_link(__('(Edit)'), ' ', ''); |
|
| 216 | 216 | ?> |
| 217 | 217 | </div> |
| 218 | 218 | |
| 219 | - <?php if ( $comment->comment_approved == '0' ) : ?> |
|
| 220 | - <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></em> |
|
| 219 | + <?php if ($comment->comment_approved == '0') : ?> |
|
| 220 | + <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.'); ?></em> |
|
| 221 | 221 | <br /> |
| 222 | 222 | <?php endif; ?> |
| 223 | 223 | |
@@ -225,10 +225,10 @@ discard block |
||
| 225 | 225 | <?php comment_text(); ?> |
| 226 | 226 | |
| 227 | 227 | <div class="reply"> |
| 228 | - <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> |
|
| 228 | + <?php comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> |
|
| 229 | 229 | </div> |
| 230 | 230 | |
| 231 | - <?php if ( 'div' != $args['style'] ) : ?> |
|
| 231 | + <?php if ('div' != $args['style']) : ?> |
|
| 232 | 232 | </div> |
| 233 | 233 | |
| 234 | 234 | <?php endif; ?> |
@@ -129,8 +129,11 @@ |
||
| 129 | 129 | <?php the_post_thumbnail(); ?> |
| 130 | 130 | </div><!-- .post-thumbnail --> |
| 131 | 131 | |
| 132 | - <?php else : ?> |
|
| 133 | - <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> |
|
| 132 | + <?php else { |
|
| 133 | + : ?> |
|
| 134 | + <a class="post-thumbnail" href="<?php the_permalink(); |
|
| 135 | +} |
|
| 136 | +?>" aria-hidden="true" tabindex="-1"> |
|
| 134 | 137 | <?php |
| 135 | 138 | the_post_thumbnail( 'post-thumbnail', array( |
| 136 | 139 | 'alt' => the_title_attribute( array( |
@@ -17,18 +17,18 @@ discard block |
||
| 17 | 17 | * @uses designfly_header_style() |
| 18 | 18 | */ |
| 19 | 19 | function designfly_custom_header_setup() { |
| 20 | - add_theme_support( 'custom-header', apply_filters( 'designfly_custom_header_args', array( |
|
| 20 | + add_theme_support('custom-header', apply_filters('designfly_custom_header_args', array( |
|
| 21 | 21 | 'default-image' => '', |
| 22 | 22 | 'default-text-color' => 'ffffff', |
| 23 | 23 | 'width' => 1000, |
| 24 | 24 | 'height' => 544, |
| 25 | 25 | 'flex-height' => false, |
| 26 | 26 | 'wp-head-callback' => 'designfly_header_style', |
| 27 | - ) ) ); |
|
| 27 | + ))); |
|
| 28 | 28 | } |
| 29 | -add_action( 'after_setup_theme', 'designfly_custom_header_setup' ); |
|
| 29 | +add_action('after_setup_theme', 'designfly_custom_header_setup'); |
|
| 30 | 30 | |
| 31 | -if ( ! function_exists( 'designfly_header_style' ) ) : |
|
| 31 | +if ( ! function_exists('designfly_header_style')) : |
|
| 32 | 32 | /** |
| 33 | 33 | * Styles the header image and text displayed on the blog. |
| 34 | 34 | * |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * If no custom options for text are set, let's bail. |
| 42 | 42 | * get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ). |
| 43 | 43 | */ |
| 44 | - if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { |
|
| 44 | + if (get_theme_support('custom-header', 'default-text-color') === $header_text_color) { |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | <style type="text/css"> |
| 51 | 51 | <?php |
| 52 | 52 | // Has the text been hidden? |
| 53 | - if ( ! display_header_text() ) : |
|
| 53 | + if ( ! display_header_text()) : |
|
| 54 | 54 | ?> |
| 55 | 55 | .site-title, |
| 56 | 56 | .site-description { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ?> |
| 64 | 64 | .site-title a, |
| 65 | 65 | .site-description { |
| 66 | - color: #<?php echo esc_attr( $header_text_color ); ?>; |
|
| 66 | + color: #<?php echo esc_attr($header_text_color); ?>; |
|
| 67 | 67 | } |
| 68 | 68 | <?php endif; ?> |
| 69 | 69 | </style> |
@@ -59,11 +59,14 @@ |
||
| 59 | 59 | } |
| 60 | 60 | <?php |
| 61 | 61 | // If the user has set a custom color for the text use that. |
| 62 | - else : |
|
| 62 | + else { |
|
| 63 | + : |
|
| 63 | 64 | ?> |
| 64 | 65 | .site-title a, |
| 65 | 66 | .site-description { |
| 66 | - color: #<?php echo esc_attr( $header_text_color ); ?>; |
|
| 67 | + color: #<?php echo esc_attr( $header_text_color ); |
|
| 68 | + } |
|
| 69 | + ?>; |
|
| 67 | 70 | } |
| 68 | 71 | <?php endif; ?> |
| 69 | 72 | </style> |
@@ -2,82 +2,82 @@ |
||
| 2 | 2 | |
| 3 | 3 | class Designfly_Portfolio_Widget extends WP_Widget { |
| 4 | 4 | |
| 5 | - // setup the widget name, description, etc... |
|
| 6 | - public function __construct() { |
|
| 5 | + // setup the widget name, description, etc... |
|
| 6 | + public function __construct() { |
|
| 7 | 7 | |
| 8 | - $widget_ops = array( |
|
| 9 | - 'classname' => 'designfly_portfolio_widget', // html class name |
|
| 10 | - 'description' => 'Custom DesignFly Portfolio Widget', |
|
| 11 | - ); |
|
| 8 | + $widget_ops = array( |
|
| 9 | + 'classname' => 'designfly_portfolio_widget', // html class name |
|
| 10 | + 'description' => 'Custom DesignFly Portfolio Widget', |
|
| 11 | + ); |
|
| 12 | 12 | |
| 13 | - parent::__construct( 'designfly_portfolio', 'Designfly Portfolio', $widget_ops ); |
|
| 14 | - } |
|
| 13 | + parent::__construct( 'designfly_portfolio', 'Designfly Portfolio', $widget_ops ); |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - // handles the back-end of the widget(rendering) |
|
| 17 | - public function form( $instance ) { |
|
| 18 | - if ( isset( $instance[ 'title' ] ) ) { |
|
| 19 | - $title = $instance[ 'title' ]; |
|
| 20 | - } else { |
|
| 21 | - $title = 'Portfolio'; |
|
| 22 | - } |
|
| 23 | - ?> |
|
| 16 | + // handles the back-end of the widget(rendering) |
|
| 17 | + public function form( $instance ) { |
|
| 18 | + if ( isset( $instance[ 'title' ] ) ) { |
|
| 19 | + $title = $instance[ 'title' ]; |
|
| 20 | + } else { |
|
| 21 | + $title = 'Portfolio'; |
|
| 22 | + } |
|
| 23 | + ?> |
|
| 24 | 24 | <p> |
| 25 | 25 | <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> |
| 26 | 26 | <input class="widget_portfolio_title" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> |
| 27 | 27 | </p> |
| 28 | 28 | <?php |
| 29 | - } |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - // handles the front-end of the widget |
|
| 32 | - public function widget( $args, $instance ) { |
|
| 33 | - echo $args[ 'before_widget' ]; |
|
| 31 | + // handles the front-end of the widget |
|
| 32 | + public function widget( $args, $instance ) { |
|
| 33 | + echo $args[ 'before_widget' ]; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * render out portfolio items |
|
| 37 | - */ |
|
| 38 | - $query = new WP_Query( array( |
|
| 39 | - 'post_type' => 'df-portfolio', |
|
| 40 | - 'posts_per_page' => 8, |
|
| 41 | - ) |
|
| 42 | - ); |
|
| 35 | + /** |
|
| 36 | + * render out portfolio items |
|
| 37 | + */ |
|
| 38 | + $query = new WP_Query( array( |
|
| 39 | + 'post_type' => 'df-portfolio', |
|
| 40 | + 'posts_per_page' => 8, |
|
| 41 | + ) |
|
| 42 | + ); |
|
| 43 | 43 | |
| 44 | - if ( $query -> have_posts() ): |
|
| 45 | - ?> |
|
| 44 | + if ( $query -> have_posts() ): |
|
| 45 | + ?> |
|
| 46 | 46 | <h2 class="widget-title"> |
| 47 | 47 | <?php |
| 48 | - if ( isset( $instance[ 'title' ] ) ) { |
|
| 49 | - $title = $instance[ 'title' ]; |
|
| 50 | - } else { |
|
| 51 | - $title = 'Portfolio'; |
|
| 52 | - } |
|
| 53 | - echo $title; |
|
| 54 | - ?> |
|
| 48 | + if ( isset( $instance[ 'title' ] ) ) { |
|
| 49 | + $title = $instance[ 'title' ]; |
|
| 50 | + } else { |
|
| 51 | + $title = 'Portfolio'; |
|
| 52 | + } |
|
| 53 | + echo $title; |
|
| 54 | + ?> |
|
| 55 | 55 | </h2> |
| 56 | 56 | <div id="portfolio-widget-wrapper"> |
| 57 | 57 | |
| 58 | 58 | <?php |
| 59 | - while ( $query -> have_posts() ): |
|
| 60 | - $query -> the_post(); |
|
| 61 | - get_template_part( 'template-parts/content', 'df-portfolio' ); |
|
| 62 | - endwhile; |
|
| 63 | - ?> |
|
| 59 | + while ( $query -> have_posts() ): |
|
| 60 | + $query -> the_post(); |
|
| 61 | + get_template_part( 'template-parts/content', 'df-portfolio' ); |
|
| 62 | + endwhile; |
|
| 63 | + ?> |
|
| 64 | 64 | </div> |
| 65 | 65 | |
| 66 | 66 | <?php |
| 67 | - else: |
|
| 68 | - ?> |
|
| 67 | + else: |
|
| 68 | + ?> |
|
| 69 | 69 | <p> |
| 70 | 70 | <?php _e( 'Sorry, no portfolio items found.', 'textdomain' ); ?> |
| 71 | 71 | </p> |
| 72 | 72 | <?php |
| 73 | - endif; |
|
| 73 | + endif; |
|
| 74 | 74 | |
| 75 | - // done rendering |
|
| 75 | + // done rendering |
|
| 76 | 76 | |
| 77 | - echo $args[ 'after_widget' ]; |
|
| 78 | - } |
|
| 77 | + echo $args[ 'after_widget' ]; |
|
| 78 | + } |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | add_action( 'widgets_init', function() { |
| 82 | - register_widget( 'Designfly_Portfolio_Widget' ); |
|
| 82 | + register_widget( 'Designfly_Portfolio_Widget' ); |
|
| 83 | 83 | } ); |
| 84 | 84 | \ No newline at end of file |
@@ -10,43 +10,43 @@ discard block |
||
| 10 | 10 | 'description' => 'Custom DesignFly Portfolio Widget', |
| 11 | 11 | ); |
| 12 | 12 | |
| 13 | - parent::__construct( 'designfly_portfolio', 'Designfly Portfolio', $widget_ops ); |
|
| 13 | + parent::__construct('designfly_portfolio', 'Designfly Portfolio', $widget_ops); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | // handles the back-end of the widget(rendering) |
| 17 | - public function form( $instance ) { |
|
| 18 | - if ( isset( $instance[ 'title' ] ) ) { |
|
| 19 | - $title = $instance[ 'title' ]; |
|
| 17 | + public function form($instance) { |
|
| 18 | + if (isset($instance['title'])) { |
|
| 19 | + $title = $instance['title']; |
|
| 20 | 20 | } else { |
| 21 | 21 | $title = 'Portfolio'; |
| 22 | 22 | } |
| 23 | 23 | ?> |
| 24 | 24 | <p> |
| 25 | - <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> |
|
| 26 | - <input class="widget_portfolio_title" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> |
|
| 25 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> |
|
| 26 | + <input class="widget_portfolio_title" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> |
|
| 27 | 27 | </p> |
| 28 | 28 | <?php |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // handles the front-end of the widget |
| 32 | - public function widget( $args, $instance ) { |
|
| 33 | - echo $args[ 'before_widget' ]; |
|
| 32 | + public function widget($args, $instance) { |
|
| 33 | + echo $args['before_widget']; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * render out portfolio items |
| 37 | 37 | */ |
| 38 | - $query = new WP_Query( array( |
|
| 38 | + $query = new WP_Query(array( |
|
| 39 | 39 | 'post_type' => 'df-portfolio', |
| 40 | 40 | 'posts_per_page' => 8, |
| 41 | 41 | ) |
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | - if ( $query -> have_posts() ): |
|
| 44 | + if ($query -> have_posts()): |
|
| 45 | 45 | ?> |
| 46 | 46 | <h2 class="widget-title"> |
| 47 | 47 | <?php |
| 48 | - if ( isset( $instance[ 'title' ] ) ) { |
|
| 49 | - $title = $instance[ 'title' ]; |
|
| 48 | + if (isset($instance['title'])) { |
|
| 49 | + $title = $instance['title']; |
|
| 50 | 50 | } else { |
| 51 | 51 | $title = 'Portfolio'; |
| 52 | 52 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | <div id="portfolio-widget-wrapper"> |
| 57 | 57 | |
| 58 | 58 | <?php |
| 59 | - while ( $query -> have_posts() ): |
|
| 59 | + while ($query -> have_posts()): |
|
| 60 | 60 | $query -> the_post(); |
| 61 | - get_template_part( 'template-parts/content', 'df-portfolio' ); |
|
| 61 | + get_template_part('template-parts/content', 'df-portfolio'); |
|
| 62 | 62 | endwhile; |
| 63 | 63 | ?> |
| 64 | 64 | </div> |
@@ -67,17 +67,17 @@ discard block |
||
| 67 | 67 | else: |
| 68 | 68 | ?> |
| 69 | 69 | <p> |
| 70 | - <?php _e( 'Sorry, no portfolio items found.', 'textdomain' ); ?> |
|
| 70 | + <?php _e('Sorry, no portfolio items found.', 'textdomain'); ?> |
|
| 71 | 71 | </p> |
| 72 | 72 | <?php |
| 73 | 73 | endif; |
| 74 | 74 | |
| 75 | 75 | // done rendering |
| 76 | 76 | |
| 77 | - echo $args[ 'after_widget' ]; |
|
| 77 | + echo $args['after_widget']; |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | -add_action( 'widgets_init', function() { |
|
| 82 | - register_widget( 'Designfly_Portfolio_Widget' ); |
|
| 81 | +add_action('widgets_init', function() { |
|
| 82 | + register_widget('Designfly_Portfolio_Widget'); |
|
| 83 | 83 | } ); |
| 84 | 84 | \ No newline at end of file |
@@ -64,10 +64,13 @@ |
||
| 64 | 64 | </div> |
| 65 | 65 | |
| 66 | 66 | <?php |
| 67 | - else: |
|
| 67 | + else { |
|
| 68 | + : |
|
| 68 | 69 | ?> |
| 69 | 70 | <p> |
| 70 | - <?php _e( 'Sorry, no portfolio items found.', 'textdomain' ); ?> |
|
| 71 | + <?php _e( 'Sorry, no portfolio items found.', 'textdomain' ); |
|
| 72 | + } |
|
| 73 | + ?> |
|
| 71 | 74 | </p> |
| 72 | 75 | <?php |
| 73 | 76 | endif; |
@@ -16,17 +16,17 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function designfly_jetpack_setup() { |
| 18 | 18 | // Add theme support for Infinite Scroll. |
| 19 | - add_theme_support( 'infinite-scroll', array( |
|
| 19 | + add_theme_support('infinite-scroll', array( |
|
| 20 | 20 | 'container' => 'main', |
| 21 | 21 | 'render' => 'designfly_infinite_scroll_render', |
| 22 | 22 | 'footer' => 'page', |
| 23 | - ) ); |
|
| 23 | + )); |
|
| 24 | 24 | |
| 25 | 25 | // Add theme support for Responsive Videos. |
| 26 | - add_theme_support( 'jetpack-responsive-videos' ); |
|
| 26 | + add_theme_support('jetpack-responsive-videos'); |
|
| 27 | 27 | |
| 28 | 28 | // Add theme support for Content Options. |
| 29 | - add_theme_support( 'jetpack-content-options', array( |
|
| 29 | + add_theme_support('jetpack-content-options', array( |
|
| 30 | 30 | 'post-details' => array( |
| 31 | 31 | 'stylesheet' => 'designfly-style', |
| 32 | 32 | 'date' => '.posted-on', |
@@ -40,20 +40,20 @@ discard block |
||
| 40 | 40 | 'post' => true, |
| 41 | 41 | 'page' => true, |
| 42 | 42 | ), |
| 43 | - ) ); |
|
| 43 | + )); |
|
| 44 | 44 | } |
| 45 | -add_action( 'after_setup_theme', 'designfly_jetpack_setup' ); |
|
| 45 | +add_action('after_setup_theme', 'designfly_jetpack_setup'); |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Custom render function for Infinite Scroll. |
| 49 | 49 | */ |
| 50 | 50 | function designfly_infinite_scroll_render() { |
| 51 | - while ( have_posts() ) { |
|
| 51 | + while (have_posts()) { |
|
| 52 | 52 | the_post(); |
| 53 | - if ( is_search() ) : |
|
| 54 | - get_template_part( 'template-parts/content', 'search' ); |
|
| 53 | + if (is_search()) : |
|
| 54 | + get_template_part('template-parts/content', 'search'); |
|
| 55 | 55 | else : |
| 56 | - get_template_part( 'template-parts/content', get_post_type() ); |
|
| 56 | + get_template_part('template-parts/content', get_post_type()); |
|
| 57 | 57 | endif; |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -52,8 +52,10 @@ |
||
| 52 | 52 | the_post(); |
| 53 | 53 | if ( is_search() ) : |
| 54 | 54 | get_template_part( 'template-parts/content', 'search' ); |
| 55 | - else : |
|
| 55 | + else { |
|
| 56 | + : |
|
| 56 | 57 | get_template_part( 'template-parts/content', get_post_type() ); |
| 58 | + } |
|
| 57 | 59 | endif; |
| 58 | 60 | } |
| 59 | 61 | } |
@@ -10,23 +10,23 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
| 12 | 12 | */ |
| 13 | -function designfly_customize_register( $wp_customize ) { |
|
| 14 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
| 15 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
| 16 | - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; |
|
| 13 | +function designfly_customize_register($wp_customize) { |
|
| 14 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
| 15 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
| 16 | + $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; |
|
| 17 | 17 | |
| 18 | - if ( isset( $wp_customize->selective_refresh ) ) { |
|
| 19 | - $wp_customize->selective_refresh->add_partial( 'blogname', array( |
|
| 18 | + if (isset($wp_customize->selective_refresh)) { |
|
| 19 | + $wp_customize->selective_refresh->add_partial('blogname', array( |
|
| 20 | 20 | 'selector' => '.site-title a', |
| 21 | 21 | 'render_callback' => 'designfly_customize_partial_blogname', |
| 22 | - ) ); |
|
| 23 | - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( |
|
| 22 | + )); |
|
| 23 | + $wp_customize->selective_refresh->add_partial('blogdescription', array( |
|
| 24 | 24 | 'selector' => '.site-description', |
| 25 | 25 | 'render_callback' => 'designfly_customize_partial_blogdescription', |
| 26 | - ) ); |
|
| 26 | + )); |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | -add_action( 'customize_register', 'designfly_customize_register' ); |
|
| 29 | +add_action('customize_register', 'designfly_customize_register'); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Render the site title for the selective refresh partial. |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | 36 | function designfly_customize_partial_blogname() { |
| 37 | - bloginfo( 'name' ); |
|
| 37 | + bloginfo('name'); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | 45 | function designfly_customize_partial_blogdescription() { |
| 46 | - bloginfo( 'description' ); |
|
| 46 | + bloginfo('description'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
| 51 | 51 | */ |
| 52 | 52 | function designfly_customize_preview_js() { |
| 53 | - wp_enqueue_script( 'designfly-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); |
|
| 53 | + wp_enqueue_script('designfly-customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), '20151215', true); |
|
| 54 | 54 | } |
| 55 | -add_action( 'customize_preview_init', 'designfly_customize_preview_js' ); |
|
| 55 | +add_action('customize_preview_init', 'designfly_customize_preview_js'); |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -61,63 +61,63 @@ discard block |
||
| 61 | 61 | * @since 1.0.5 |
| 62 | 62 | */ |
| 63 | 63 | |
| 64 | - function register_home_mods( $wp_customize ) { |
|
| 64 | + function register_home_mods($wp_customize) { |
|
| 65 | 65 | /* Home Page Settings */ |
| 66 | 66 | // 'Home Page' display header section or not |
| 67 | - $wp_customize -> add_setting( 'designfly-home-display-header', array( |
|
| 67 | + $wp_customize -> add_setting('designfly-home-display-header', array( |
|
| 68 | 68 | 'default' => 'Yes' |
| 69 | - ) ); |
|
| 69 | + )); |
|
| 70 | 70 | |
| 71 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-home-display-header-control', |
|
| 71 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-home-display-header-control', |
|
| 72 | 72 | array( |
| 73 | 73 | 'label' => 'Display header section', |
| 74 | 74 | 'section' => 'static_front_page', |
| 75 | 75 | 'settings' => 'designfly-home-display-header', |
| 76 | 76 | 'type' => 'checkbox', |
| 77 | 77 | 'priority' => 1, |
| 78 | - ) ) ); |
|
| 78 | + ))); |
|
| 79 | 79 | |
| 80 | 80 | // 'Home page' display recent portfolio |
| 81 | - $wp_customize -> add_setting( 'designfly-home-display-portfolio', array( |
|
| 81 | + $wp_customize -> add_setting('designfly-home-display-portfolio', array( |
|
| 82 | 82 | 'default' => 'Yes' |
| 83 | - ) ); |
|
| 83 | + )); |
|
| 84 | 84 | |
| 85 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-home-display-portfolio-control', |
|
| 85 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-home-display-portfolio-control', |
|
| 86 | 86 | array( |
| 87 | 87 | 'label' => 'Display latest portfolio items', |
| 88 | 88 | 'section' => 'static_front_page', |
| 89 | 89 | 'settings' => 'designfly-home-display-portfolio', |
| 90 | 90 | 'type' => 'checkbox', |
| 91 | 91 | 'priority' => 2, |
| 92 | - ) ) ); |
|
| 92 | + ))); |
|
| 93 | 93 | |
| 94 | 94 | // 'Home Page' portfolio section title |
| 95 | - $wp_customize -> add_setting( 'designfly-home-portfolio-title', array( |
|
| 95 | + $wp_customize -> add_setting('designfly-home-portfolio-title', array( |
|
| 96 | 96 | 'default' => 'D\'sign is the soul' |
| 97 | - ) ); |
|
| 97 | + )); |
|
| 98 | 98 | |
| 99 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-home-portfolio-title-control', |
|
| 99 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-home-portfolio-title-control', |
|
| 100 | 100 | array( |
| 101 | 101 | 'label' => 'Portfolio Section Title', |
| 102 | 102 | 'section' => 'static_front_page', |
| 103 | 103 | 'settings' => 'designfly-home-portfolio-title', |
| 104 | 104 | 'type' => 'text', |
| 105 | 105 | 'priority' => 3, |
| 106 | - ) ) ); |
|
| 106 | + ))); |
|
| 107 | 107 | |
| 108 | 108 | // 'Home Page' View all button url |
| 109 | - $wp_customize -> add_setting( 'designfly-home-portfolio-btn', array( |
|
| 109 | + $wp_customize -> add_setting('designfly-home-portfolio-btn', array( |
|
| 110 | 110 | 'default' => '', |
| 111 | - ) ); |
|
| 111 | + )); |
|
| 112 | 112 | |
| 113 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-hoome-portfolio-btn-control', |
|
| 113 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-hoome-portfolio-btn-control', |
|
| 114 | 114 | array( |
| 115 | 115 | 'label' => 'Portfolio \'View all\' button url', |
| 116 | 116 | 'section' => 'static_front_page', |
| 117 | 117 | 'settings' => 'designfly-home-portfolio-btn', |
| 118 | 118 | 'type' => 'dropdown-pages', |
| 119 | 119 | 'priority' => 4, |
| 120 | - ) ) ); |
|
| 120 | + ))); |
|
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | |
@@ -126,67 +126,67 @@ discard block |
||
| 126 | 126 | * |
| 127 | 127 | * @since 1.0.5 |
| 128 | 128 | */ |
| 129 | -function register_footer_mods( $wp_customize ) { |
|
| 130 | - $wp_customize -> add_section( 'designfly-footer-section', array( |
|
| 129 | +function register_footer_mods($wp_customize) { |
|
| 130 | + $wp_customize -> add_section('designfly-footer-section', array( |
|
| 131 | 131 | 'title' => 'Footer settings' |
| 132 | - ) ); |
|
| 132 | + )); |
|
| 133 | 133 | |
| 134 | 134 | // contact info |
| 135 | - $wp_customize -> add_setting( 'designfly-footer-contact', array( |
|
| 135 | + $wp_customize -> add_setting('designfly-footer-contact', array( |
|
| 136 | 136 | 'capability' => 'edit_theme_options', |
| 137 | 137 | 'default' => 'Street 21 Planet, A-11, california <br> Tel: 91234 42354' |
| 138 | - ) ); |
|
| 138 | + )); |
|
| 139 | 139 | |
| 140 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-footer-contact-control', |
|
| 140 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-footer-contact-control', |
|
| 141 | 141 | array( |
| 142 | 142 | 'label' => 'Contact info(use \'<br>\' for new line)', |
| 143 | 143 | 'section' => 'designfly-footer-section', |
| 144 | 144 | 'settings' => 'designfly-footer-contact', |
| 145 | 145 | 'type' => 'textarea', |
| 146 | - ) ) ); |
|
| 146 | + ))); |
|
| 147 | 147 | |
| 148 | 148 | |
| 149 | - $wp_customize -> add_setting( 'designfly-footer-email', array( |
|
| 149 | + $wp_customize -> add_setting('designfly-footer-email', array( |
|
| 150 | 150 | 'capability' => 'edit_theme_options', |
| 151 | 151 | 'default' => '' |
| 152 | - ) ); |
|
| 152 | + )); |
|
| 153 | 153 | |
| 154 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-footer-email-control', |
|
| 154 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-footer-email-control', |
|
| 155 | 155 | array( |
| 156 | 156 | 'label' => 'Contact email', |
| 157 | 157 | 'section' => 'designfly-footer-section', |
| 158 | 158 | 'settings' => 'designfly-footer-email', |
| 159 | 159 | 'type' => 'text', |
| 160 | - ) ) ); |
|
| 160 | + ))); |
|
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | // Site info text |
| 164 | - $wp_customize -> add_setting( 'designfly-footer-info', array( |
|
| 164 | + $wp_customize -> add_setting('designfly-footer-info', array( |
|
| 165 | 165 | 'capability' => 'edit_theme_options', |
| 166 | 166 | 'default' => '2012 - DESIGNfly' |
| 167 | - ) ); |
|
| 167 | + )); |
|
| 168 | 168 | |
| 169 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-footer-info-control', |
|
| 169 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-footer-info-control', |
|
| 170 | 170 | array( |
| 171 | 171 | 'label' => 'Site info text', |
| 172 | 172 | 'section' => 'designfly-footer-section', |
| 173 | 173 | 'settings' => 'designfly-footer-info', |
| 174 | 174 | 'type' => 'text', |
| 175 | - ) ) ); |
|
| 175 | + ))); |
|
| 176 | 176 | |
| 177 | 177 | // Social media urls |
| 178 | - $wp_customize -> add_setting( 'designfly-footer-urls', array( |
|
| 178 | + $wp_customize -> add_setting('designfly-footer-urls', array( |
|
| 179 | 179 | 'capability' => 'edit_theme_options', |
| 180 | 180 | 'default' => 'https://www.facebook.com/' |
| 181 | - ) ); |
|
| 181 | + )); |
|
| 182 | 182 | |
| 183 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-footer-urls-control', |
|
| 183 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-footer-urls-control', |
|
| 184 | 184 | array( |
| 185 | 185 | 'label' => 'Social site urls(separate urls with a semicolon(;))', |
| 186 | 186 | 'section' => 'designfly-footer-section', |
| 187 | 187 | 'settings' => 'designfly-footer-urls', |
| 188 | 188 | 'type' => 'textarea', |
| 189 | - ) ) ); |
|
| 189 | + ))); |
|
| 190 | 190 | |
| 191 | 191 | } |
| 192 | 192 | |
@@ -195,137 +195,137 @@ discard block |
||
| 195 | 195 | * @since 1.0.2 |
| 196 | 196 | */ |
| 197 | 197 | |
| 198 | -function register_features_mods( $wp_customize ) { |
|
| 199 | - $wp_customize -> add_section( 'designfly-features-section', array( |
|
| 198 | +function register_features_mods($wp_customize) { |
|
| 199 | + $wp_customize -> add_section('designfly-features-section', array( |
|
| 200 | 200 | 'title' => 'Services bar' |
| 201 | - ) ); |
|
| 201 | + )); |
|
| 202 | 202 | |
| 203 | 203 | /* Features settings */ |
| 204 | 204 | // 'Features' display or not |
| 205 | - $wp_customize -> add_setting( 'designfly-features-display', array( |
|
| 205 | + $wp_customize -> add_setting('designfly-features-display', array( |
|
| 206 | 206 | 'default' => 'Yes' |
| 207 | - ) ); |
|
| 207 | + )); |
|
| 208 | 208 | |
| 209 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-display-control', |
|
| 209 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-display-control', |
|
| 210 | 210 | array( |
| 211 | 211 | 'label' => 'Display features?', |
| 212 | 212 | 'section' => 'designfly-features-section', |
| 213 | 213 | 'settings' => 'designfly-features-display', |
| 214 | 214 | 'type' => 'checkbox', |
| 215 | - ) ) ); |
|
| 215 | + ))); |
|
| 216 | 216 | /* Features block-1 */ |
| 217 | 217 | // 'Features' title |
| 218 | - $wp_customize -> add_setting( 'designfly-features-title-1', array( |
|
| 218 | + $wp_customize -> add_setting('designfly-features-title-1', array( |
|
| 219 | 219 | 'default' => 'Title Text' |
| 220 | - ) ); |
|
| 220 | + )); |
|
| 221 | 221 | |
| 222 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-title-control-1', |
|
| 222 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-title-control-1', |
|
| 223 | 223 | array( |
| 224 | 224 | 'label' => 'Title-1', |
| 225 | 225 | 'section' => 'designfly-features-section', |
| 226 | 226 | 'settings' => 'designfly-features-title-1', |
| 227 | - ) ) ); |
|
| 227 | + ))); |
|
| 228 | 228 | |
| 229 | 229 | // 'Features' paragraph |
| 230 | - $wp_customize -> add_setting( 'designfly-features-para-1', array( |
|
| 230 | + $wp_customize -> add_setting('designfly-features-para-1', array( |
|
| 231 | 231 | 'default' => 'Description about the service...' |
| 232 | - ) ); |
|
| 232 | + )); |
|
| 233 | 233 | |
| 234 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-para-control-1', |
|
| 234 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-para-control-1', |
|
| 235 | 235 | array( |
| 236 | 236 | 'label' => 'Description-1', |
| 237 | 237 | 'section' => 'designfly-features-section', |
| 238 | 238 | 'settings' => 'designfly-features-para-1', |
| 239 | 239 | 'type' => 'textarea', |
| 240 | - ) ) ); |
|
| 240 | + ))); |
|
| 241 | 241 | |
| 242 | 242 | // 'Features' Image |
| 243 | - $wp_customize -> add_setting( 'designfly-features-image-1' ); |
|
| 243 | + $wp_customize -> add_setting('designfly-features-image-1'); |
|
| 244 | 244 | |
| 245 | - $wp_customize -> add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'designfly-features-image-control-1', |
|
| 245 | + $wp_customize -> add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'designfly-features-image-control-1', |
|
| 246 | 246 | array( |
| 247 | 247 | 'label' => 'Image-1', |
| 248 | 248 | 'section' => 'designfly-features-section', |
| 249 | 249 | 'settings' => 'designfly-features-image-1', |
| 250 | 250 | 'width' => 50, |
| 251 | 251 | 'height' => 50, |
| 252 | - ) ) ); |
|
| 252 | + ))); |
|
| 253 | 253 | |
| 254 | 254 | /* Features block-2 */ |
| 255 | 255 | // 'Features' title |
| 256 | - $wp_customize -> add_setting( 'designfly-features-title-2', array( |
|
| 256 | + $wp_customize -> add_setting('designfly-features-title-2', array( |
|
| 257 | 257 | 'default' => 'Title Text' |
| 258 | - ) ); |
|
| 258 | + )); |
|
| 259 | 259 | |
| 260 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-title-control-2', |
|
| 260 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-title-control-2', |
|
| 261 | 261 | array( |
| 262 | 262 | 'label' => 'Title-2', |
| 263 | 263 | 'section' => 'designfly-features-section', |
| 264 | 264 | 'settings' => 'designfly-features-title-2', |
| 265 | - ) ) ); |
|
| 265 | + ))); |
|
| 266 | 266 | |
| 267 | 267 | // 'Features' paragraph |
| 268 | - $wp_customize -> add_setting( 'designfly-features-para-2', array( |
|
| 268 | + $wp_customize -> add_setting('designfly-features-para-2', array( |
|
| 269 | 269 | 'default' => 'Description about the service...' |
| 270 | - ) ); |
|
| 270 | + )); |
|
| 271 | 271 | |
| 272 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-para-control-2', |
|
| 272 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-para-control-2', |
|
| 273 | 273 | array( |
| 274 | 274 | 'label' => 'Description-2', |
| 275 | 275 | 'section' => 'designfly-features-section', |
| 276 | 276 | 'settings' => 'designfly-features-para-2', |
| 277 | 277 | 'type' => 'textarea', |
| 278 | - ) ) ); |
|
| 278 | + ))); |
|
| 279 | 279 | |
| 280 | 280 | // 'Features' Image |
| 281 | - $wp_customize -> add_setting( 'designfly-features-image-2' ); |
|
| 281 | + $wp_customize -> add_setting('designfly-features-image-2'); |
|
| 282 | 282 | |
| 283 | - $wp_customize -> add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'designfly-features-image-control-2', |
|
| 283 | + $wp_customize -> add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'designfly-features-image-control-2', |
|
| 284 | 284 | array( |
| 285 | 285 | 'label' => 'Image-2', |
| 286 | 286 | 'section' => 'designfly-features-section', |
| 287 | 287 | 'settings' => 'designfly-features-image-2', |
| 288 | 288 | 'width' => 50, |
| 289 | 289 | 'height' => 50, |
| 290 | - ) ) ); |
|
| 290 | + ))); |
|
| 291 | 291 | |
| 292 | 292 | /* Features block-1 */ |
| 293 | 293 | // 'Features' title |
| 294 | - $wp_customize -> add_setting( 'designfly-features-title-3', array( |
|
| 294 | + $wp_customize -> add_setting('designfly-features-title-3', array( |
|
| 295 | 295 | 'default' => 'Title Text' |
| 296 | - ) ); |
|
| 296 | + )); |
|
| 297 | 297 | |
| 298 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-title-control-3', |
|
| 298 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-title-control-3', |
|
| 299 | 299 | array( |
| 300 | 300 | 'label' => 'Title-3', |
| 301 | 301 | 'section' => 'designfly-features-section', |
| 302 | 302 | 'settings' => 'designfly-features-title-3', |
| 303 | - ) ) ); |
|
| 303 | + ))); |
|
| 304 | 304 | |
| 305 | 305 | // 'Features' paragraph |
| 306 | - $wp_customize -> add_setting( 'designfly-features-para-3', array( |
|
| 306 | + $wp_customize -> add_setting('designfly-features-para-3', array( |
|
| 307 | 307 | 'default' => 'Description about the service...' |
| 308 | - ) ); |
|
| 308 | + )); |
|
| 309 | 309 | |
| 310 | - $wp_customize -> add_control( new WP_Customize_Control( $wp_customize, 'designfly-features-para-control-3', |
|
| 310 | + $wp_customize -> add_control(new WP_Customize_Control($wp_customize, 'designfly-features-para-control-3', |
|
| 311 | 311 | array( |
| 312 | 312 | 'label' => 'Description-3', |
| 313 | 313 | 'section' => 'designfly-features-section', |
| 314 | 314 | 'settings' => 'designfly-features-para-3', |
| 315 | 315 | 'type' => 'textarea', |
| 316 | - ) ) ); |
|
| 316 | + ))); |
|
| 317 | 317 | |
| 318 | 318 | // 'Features' Image |
| 319 | - $wp_customize -> add_setting( 'designfly-features-image-3' ); |
|
| 319 | + $wp_customize -> add_setting('designfly-features-image-3'); |
|
| 320 | 320 | |
| 321 | - $wp_customize -> add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'designfly-features-image-control-3', |
|
| 321 | + $wp_customize -> add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'designfly-features-image-control-3', |
|
| 322 | 322 | array( |
| 323 | 323 | 'label' => 'Image-3', |
| 324 | 324 | 'section' => 'designfly-features-section', |
| 325 | 325 | 'settings' => 'designfly-features-image-3', |
| 326 | 326 | 'width' => 50, |
| 327 | 327 | 'height' => 50, |
| 328 | - ) ) ); |
|
| 328 | + ))); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -333,10 +333,10 @@ discard block |
||
| 333 | 333 | * |
| 334 | 334 | * @since 1.0.5 |
| 335 | 335 | */ |
| 336 | - function designfly_theme_mods( $wp_customize ) { |
|
| 337 | - register_features_mods( $wp_customize ); |
|
| 338 | - register_home_mods( $wp_customize ); |
|
| 339 | - register_footer_mods( $wp_customize ); |
|
| 336 | + function designfly_theme_mods($wp_customize) { |
|
| 337 | + register_features_mods($wp_customize); |
|
| 338 | + register_home_mods($wp_customize); |
|
| 339 | + register_footer_mods($wp_customize); |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - add_action( 'customize_register', 'designfly_theme_mods' ); |
|
| 342 | + add_action('customize_register', 'designfly_theme_mods'); |
|
@@ -17,15 +17,15 @@ |
||
| 17 | 17 | <main id="main" class="site-main"> |
| 18 | 18 | |
| 19 | 19 | <?php |
| 20 | - while ( have_posts() ) : |
|
| 20 | + while (have_posts()) : |
|
| 21 | 21 | the_post(); |
| 22 | 22 | |
| 23 | - get_template_part( 'template-parts/content', get_post_type() ); |
|
| 23 | + get_template_part('template-parts/content', get_post_type()); |
|
| 24 | 24 | |
| 25 | 25 | // the_post_navigation(); |
| 26 | 26 | |
| 27 | 27 | // If comments are open or we have at least one comment, load up the comment template. |
| 28 | - if ( comments_open() || get_comments_number() ) : ?> |
|
| 28 | + if (comments_open() || get_comments_number()) : ?> |
|
| 29 | 29 | <div class="comments-wrapper"> |
| 30 | 30 | <p class="bars">Comments</p> |
| 31 | 31 | <?php comments_template(); ?> |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | function special_nav_class ($classes, $item) { |
| 197 | 197 | if (in_array('current-menu-item', $classes) ){ |
| 198 | - $classes[] = 'active '; |
|
| 198 | + $classes[] = 'active '; |
|
| 199 | 199 | } |
| 200 | 200 | return $classes; |
| 201 | 201 | } |
@@ -261,14 +261,14 @@ discard block |
||
| 261 | 261 | * @since 1.0.6 |
| 262 | 262 | */ |
| 263 | 263 | function wpdocs_excerpt_more( $more ) { |
| 264 | - if ( ! is_single() ) { |
|
| 265 | - $more = sprintf( '<a class="read-more" href="%1$s">%2$s</a>', |
|
| 266 | - get_permalink( get_the_ID() ), |
|
| 267 | - __( 'Read More', 'textdomain' ) |
|
| 268 | - ); |
|
| 269 | - } |
|
| 264 | + if ( ! is_single() ) { |
|
| 265 | + $more = sprintf( '<a class="read-more" href="%1$s">%2$s</a>', |
|
| 266 | + get_permalink( get_the_ID() ), |
|
| 267 | + __( 'Read More', 'textdomain' ) |
|
| 268 | + ); |
|
| 269 | + } |
|
| 270 | 270 | |
| 271 | - return $more; |
|
| 271 | + return $more; |
|
| 272 | 272 | } |
| 273 | 273 | add_filter( 'excerpt_more', 'wpdocs_excerpt_more' ); |
| 274 | 274 | |
@@ -284,6 +284,6 @@ discard block |
||
| 284 | 284 | * @since 1.0.4 |
| 285 | 285 | */ |
| 286 | 286 | function wpdocs_custom_excerpt_length( $length ) { |
| 287 | - return 35; |
|
| 287 | + return 35; |
|
| 288 | 288 | } |
| 289 | 289 | add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @package DesignFly |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! function_exists( 'designfly_setup' ) ) : |
|
| 10 | +if ( ! function_exists('designfly_setup')) : |
|
| 11 | 11 | /** |
| 12 | 12 | * Sets up theme defaults and registers support for various WordPress features. |
| 13 | 13 | * |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | * If you're building a theme based on DesignFly, use a find and replace |
| 23 | 23 | * to change 'designfly' to the name of your theme in all the template files. |
| 24 | 24 | */ |
| 25 | - load_theme_textdomain( 'designfly', get_template_directory() . '/languages' ); |
|
| 25 | + load_theme_textdomain('designfly', get_template_directory() . '/languages'); |
|
| 26 | 26 | |
| 27 | 27 | // Add default posts and comments RSS feed links to head. |
| 28 | - add_theme_support( 'automatic-feed-links' ); |
|
| 28 | + add_theme_support('automatic-feed-links'); |
|
| 29 | 29 | |
| 30 | 30 | /* |
| 31 | 31 | * Let WordPress manage the document title. |
@@ -33,49 +33,49 @@ discard block |
||
| 33 | 33 | * hard-coded <title> tag in the document head, and expect WordPress to |
| 34 | 34 | * provide it for us. |
| 35 | 35 | */ |
| 36 | - add_theme_support( 'title-tag' ); |
|
| 36 | + add_theme_support('title-tag'); |
|
| 37 | 37 | |
| 38 | 38 | /* |
| 39 | 39 | * Enable support for Post Thumbnails on posts and pages. |
| 40 | 40 | * |
| 41 | 41 | * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ |
| 42 | 42 | */ |
| 43 | - add_theme_support( 'post-thumbnails' ); |
|
| 43 | + add_theme_support('post-thumbnails'); |
|
| 44 | 44 | |
| 45 | 45 | // This theme uses wp_nav_menu() in one location. |
| 46 | - register_nav_menus( array( |
|
| 47 | - 'menu-1' => esc_html__( 'Primary', 'designfly' ), |
|
| 48 | - ) ); |
|
| 46 | + register_nav_menus(array( |
|
| 47 | + 'menu-1' => esc_html__('Primary', 'designfly'), |
|
| 48 | + )); |
|
| 49 | 49 | |
| 50 | 50 | /* |
| 51 | 51 | * Switch default core markup for search form, comment form, and comments |
| 52 | 52 | * to output valid HTML5. |
| 53 | 53 | */ |
| 54 | - add_theme_support( 'html5', array( |
|
| 54 | + add_theme_support('html5', array( |
|
| 55 | 55 | 'search-form', |
| 56 | 56 | 'comment-form', |
| 57 | 57 | 'comment-list', |
| 58 | 58 | 'gallery', |
| 59 | 59 | 'caption', |
| 60 | - ) ); |
|
| 60 | + )); |
|
| 61 | 61 | |
| 62 | 62 | // Add theme support for selective refresh for widgets. |
| 63 | - add_theme_support( 'customize-selective-refresh-widgets' ); |
|
| 63 | + add_theme_support('customize-selective-refresh-widgets'); |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Add support for core custom logo. |
| 67 | 67 | * |
| 68 | 68 | * @link https://codex.wordpress.org/Theme_Logo |
| 69 | 69 | */ |
| 70 | - add_theme_support( 'custom-logo', array( |
|
| 70 | + add_theme_support('custom-logo', array( |
|
| 71 | 71 | 'height' => 65, |
| 72 | 72 | 'width' => 250, |
| 73 | 73 | 'flex-width' => true, |
| 74 | 74 | 'flex-height' => false, |
| 75 | - ) ); |
|
| 75 | + )); |
|
| 76 | 76 | } |
| 77 | 77 | endif; |
| 78 | -add_action( 'after_setup_theme', 'designfly_setup' ); |
|
| 78 | +add_action('after_setup_theme', 'designfly_setup'); |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Set the content width in pixels, based on the theme's design and stylesheet. |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | // This variable is intended to be overruled from themes. |
| 89 | 89 | // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. |
| 90 | 90 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 91 | - $GLOBALS['content_width'] = apply_filters( 'designfly_content_width', 640 ); |
|
| 91 | + $GLOBALS['content_width'] = apply_filters('designfly_content_width', 640); |
|
| 92 | 92 | } |
| 93 | -add_action( 'after_setup_theme', 'designfly_content_width', 0 ); |
|
| 93 | +add_action('after_setup_theme', 'designfly_content_width', 0); |
|
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Register widget area. |
@@ -98,17 +98,17 @@ discard block |
||
| 98 | 98 | * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar |
| 99 | 99 | */ |
| 100 | 100 | function designfly_widgets_init() { |
| 101 | - register_sidebar( array( |
|
| 102 | - 'name' => esc_html__( 'Sidebar', 'designfly' ), |
|
| 101 | + register_sidebar(array( |
|
| 102 | + 'name' => esc_html__('Sidebar', 'designfly'), |
|
| 103 | 103 | 'id' => 'sidebar-1', |
| 104 | - 'description' => esc_html__( 'Add widgets here.', 'designfly' ), |
|
| 104 | + 'description' => esc_html__('Add widgets here.', 'designfly'), |
|
| 105 | 105 | 'before_widget' => '<section id="%1$s" class="widget %2$s">', |
| 106 | 106 | 'after_widget' => '</section>', |
| 107 | 107 | 'before_title' => '<h2 class="widget-title">', |
| 108 | 108 | 'after_title' => '</h2>', |
| 109 | - ) ); |
|
| 109 | + )); |
|
| 110 | 110 | } |
| 111 | -add_action( 'widgets_init', 'designfly_widgets_init' ); |
|
| 111 | +add_action('widgets_init', 'designfly_widgets_init'); |
|
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * Enqueue scripts and styles. |
@@ -123,38 +123,38 @@ discard block |
||
| 123 | 123 | wp_enqueue_style('dashicons'); |
| 124 | 124 | |
| 125 | 125 | // jquery script |
| 126 | - wp_enqueue_script( 'jquery', get_template_directory_uri() . '/lib/jquery3.4.1/jquery.js' ); |
|
| 126 | + wp_enqueue_script('jquery', get_template_directory_uri() . '/lib/jquery3.4.1/jquery.js'); |
|
| 127 | 127 | |
| 128 | 128 | // bootstrap styles |
| 129 | - wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/lib/bs-4.3.1/css/bootstrap.min.css' ); |
|
| 129 | + wp_enqueue_style('bootstrap', get_template_directory_uri() . '/lib/bs-4.3.1/css/bootstrap.min.css'); |
|
| 130 | 130 | |
| 131 | 131 | // bootstrap scripts |
| 132 | - wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/lib/bs-4.3.1/js/bootstrap.min.js', 'jquery', false, true ); |
|
| 132 | + wp_enqueue_script('bootstrap', get_template_directory_uri() . '/lib/bs-4.3.1/js/bootstrap.min.js', 'jquery', false, true); |
|
| 133 | 133 | |
| 134 | 134 | // custom css (main style) |
| 135 | - wp_enqueue_style( 'main-style', get_template_directory_uri() . '/layouts/css/main.css' ); |
|
| 135 | + wp_enqueue_style('main-style', get_template_directory_uri() . '/layouts/css/main.css'); |
|
| 136 | 136 | |
| 137 | 137 | // sidebar style |
| 138 | - wp_enqueue_style( 'sidebar-style', get_template_directory_uri() . '/layouts/sidebar-content.css' ); |
|
| 138 | + wp_enqueue_style('sidebar-style', get_template_directory_uri() . '/layouts/sidebar-content.css'); |
|
| 139 | 139 | |
| 140 | 140 | // Media queryes |
| 141 | - wp_enqueue_style( 'media-query', get_template_directory_uri() . '/layouts/css/media-queries.css' ); |
|
| 141 | + wp_enqueue_style('media-query', get_template_directory_uri() . '/layouts/css/media-queries.css'); |
|
| 142 | 142 | |
| 143 | - wp_enqueue_style( 'designfly-style', get_stylesheet_uri() ); |
|
| 143 | + wp_enqueue_style('designfly-style', get_stylesheet_uri()); |
|
| 144 | 144 | |
| 145 | 145 | // Main js file |
| 146 | - wp_enqueue_script( 'main-script', get_template_directory_uri() . '/js/main.js', 'main', false, true ); |
|
| 147 | - wp_localize_script( 'main-script', 'directory_name', array( 'templateUrl' => get_stylesheet_directory_uri() ) ); |
|
| 146 | + wp_enqueue_script('main-script', get_template_directory_uri() . '/js/main.js', 'main', false, true); |
|
| 147 | + wp_localize_script('main-script', 'directory_name', array('templateUrl' => get_stylesheet_directory_uri())); |
|
| 148 | 148 | |
| 149 | - wp_enqueue_script( 'designfly-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true ); |
|
| 149 | + wp_enqueue_script('designfly-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true); |
|
| 150 | 150 | |
| 151 | - wp_enqueue_script( 'designfly-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true ); |
|
| 151 | + wp_enqueue_script('designfly-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true); |
|
| 152 | 152 | |
| 153 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
| 154 | - wp_enqueue_script( 'comment-reply' ); |
|
| 153 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
| 154 | + wp_enqueue_script('comment-reply'); |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | -add_action( 'wp_enqueue_scripts', 'designfly_scripts' ); |
|
| 157 | +add_action('wp_enqueue_scripts', 'designfly_scripts'); |
|
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * Implement the Custom Header feature. |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /** |
| 185 | 185 | * Load Jetpack compatibility file. |
| 186 | 186 | */ |
| 187 | -if ( defined( 'JETPACK__VERSION' ) ) { |
|
| 187 | +if (defined('JETPACK__VERSION')) { |
|
| 188 | 188 | require get_template_directory() . '/inc/jetpack.php'; |
| 189 | 189 | } |
| 190 | 190 | |
@@ -193,14 +193,14 @@ discard block |
||
| 193 | 193 | * |
| 194 | 194 | * @since 1.0.2 |
| 195 | 195 | */ |
| 196 | -function special_nav_class ($classes, $item) { |
|
| 197 | - if (in_array('current-menu-item', $classes) ){ |
|
| 196 | +function special_nav_class($classes, $item) { |
|
| 197 | + if (in_array('current-menu-item', $classes)) { |
|
| 198 | 198 | $classes[] = 'active '; |
| 199 | 199 | } |
| 200 | 200 | return $classes; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | -add_filter( 'nav_menu_css_class' , 'special_nav_class' , 10 , 2 ); |
|
| 203 | +add_filter('nav_menu_css_class', 'special_nav_class', 10, 2); |
|
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | 206 | * function for registering custom post type 'portfolio' |
@@ -242,16 +242,16 @@ discard block |
||
| 242 | 242 | 'comments', |
| 243 | 243 | 'revision', |
| 244 | 244 | ), |
| 245 | - 'taxonomies' => array( 'category', 'post_tag' ), |
|
| 245 | + 'taxonomies' => array('category', 'post_tag'), |
|
| 246 | 246 | 'menu_position' => 5, |
| 247 | 247 | 'exclude_from_search' => false, |
| 248 | - 'rewrite' => array( 'slug' => 'df-portfolio' ), |
|
| 248 | + 'rewrite' => array('slug' => 'df-portfolio'), |
|
| 249 | 249 | ); |
| 250 | 250 | |
| 251 | - register_post_type( 'df-portfolio', $args ); |
|
| 251 | + register_post_type('df-portfolio', $args); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | -add_action( 'init', 'designfly_custom_post_type' ); |
|
| 254 | +add_action('init', 'designfly_custom_post_type'); |
|
| 255 | 255 | |
| 256 | 256 | /** |
| 257 | 257 | * Filter the "read more" excerpt string link to the post. |
@@ -260,21 +260,21 @@ discard block |
||
| 260 | 260 | * @return string (Maybe) modified "read more" excerpt string. |
| 261 | 261 | * @since 1.0.6 |
| 262 | 262 | */ |
| 263 | -function wpdocs_excerpt_more( $more ) { |
|
| 264 | - if ( ! is_single() ) { |
|
| 265 | - $more = sprintf( '<a class="read-more" href="%1$s">%2$s</a>', |
|
| 266 | - get_permalink( get_the_ID() ), |
|
| 267 | - __( 'Read More', 'textdomain' ) |
|
| 263 | +function wpdocs_excerpt_more($more) { |
|
| 264 | + if ( ! is_single()) { |
|
| 265 | + $more = sprintf('<a class="read-more" href="%1$s">%2$s</a>', |
|
| 266 | + get_permalink(get_the_ID()), |
|
| 267 | + __('Read More', 'textdomain') |
|
| 268 | 268 | ); |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | return $more; |
| 272 | 272 | } |
| 273 | -add_filter( 'excerpt_more', 'wpdocs_excerpt_more' ); |
|
| 273 | +add_filter('excerpt_more', 'wpdocs_excerpt_more'); |
|
| 274 | 274 | |
| 275 | 275 | |
| 276 | -add_filter( 'the_excerpt', 'do_shortcode' ); |
|
| 277 | -add_filter( 'widget_text', 'do_shortcode' ); |
|
| 276 | +add_filter('the_excerpt', 'do_shortcode'); |
|
| 277 | +add_filter('widget_text', 'do_shortcode'); |
|
| 278 | 278 | |
| 279 | 279 | /** |
| 280 | 280 | * Filter the except length to 20 words. |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | * @return int (Maybe) modified excerpt length. |
| 284 | 284 | * @since 1.0.4 |
| 285 | 285 | */ |
| 286 | -function wpdocs_custom_excerpt_length( $length ) { |
|
| 286 | +function wpdocs_custom_excerpt_length($length) { |
|
| 287 | 287 | return 35; |
| 288 | 288 | } |
| 289 | -add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); |
|
| 289 | +add_filter('excerpt_length', 'wpdocs_custom_excerpt_length', 999); |
|
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * the visitor has not yet entered the password we will |
| 16 | 16 | * return early without loading the comments. |
| 17 | 17 | */ |
| 18 | -if ( post_password_required() ) { |
|
| 18 | +if (post_password_required()) { |
|
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | 21 | ?> |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | <div id="comments" class="comments-area"> |
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | - if ( have_comments() ) : |
|
| 26 | + if (have_comments()) : |
|
| 27 | 27 | ?> |
| 28 | 28 | |
| 29 | 29 | <?php the_comments_navigation(); ?> |
| 30 | 30 | |
| 31 | 31 | <ol class="comment-list"> |
| 32 | 32 | <?php |
| 33 | - wp_list_comments( array( |
|
| 33 | + wp_list_comments(array( |
|
| 34 | 34 | 'type' => 'comment', |
| 35 | 35 | 'callback' => 'designfly_custom_comments' |
| 36 | - ) ); |
|
| 36 | + )); |
|
| 37 | 37 | ?> |
| 38 | 38 | </ol><!-- .comment-list --> |
| 39 | 39 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | the_comments_navigation(); |
| 46 | 46 | |
| 47 | 47 | // If comments are closed and there are comments, let's leave a little note, shall we? |
| 48 | - if ( ! comments_open() ) : |
|
| 48 | + if ( ! comments_open()) : |
|
| 49 | 49 | ?> |
| 50 | - <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'designfly' ); ?></p> |
|
| 50 | + <p class="no-comments"><?php esc_html_e('Comments are closed.', 'designfly'); ?></p> |
|
| 51 | 51 | <?php |
| 52 | 52 | endif; |
| 53 | 53 | |