';
- } else {
- $html .= 'col-md-12 content-area" id="primary">';
- }
- echo $html;
+if ( $is_woocommerce ) {
+ echo '
';
+} else {
+ $html = '';
+ if ( 'right' === $sidebar_pos || 'left' === $sidebar_pos ) {
+ $html = '';
- } else if ( strcasecmp( $item->title, 'divider') == 0 && $depth === 1 ) {
- $output .= $indent . ' ';
- } else if ( strcasecmp( $item->attr_title, 'dropdown-header') == 0 && $depth === 1 ) {
- $output .= $indent . ' ' . esc_attr( $item->title );
- } else if ( strcasecmp($item->attr_title, 'disabled' ) == 0 ) {
- $output .= $indent . ' ' . esc_attr( $item->title ) . '';
- } else {
- $class_names = $value = '';
- $classes = empty( $item->classes ) ? array() : (array) $item->classes;
- $classes[] = 'nav-item menu-item-' . $item->ID;
- $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
- /*
- if ( $args->has_children )
- $class_names .= ' dropdown';
- */
- if($args->has_children && $depth === 0) { $class_names .= ' dropdown'; } elseif($args->has_children && $depth > 0) { $class_names .= ' dropdown-submenu'; }
- if ( in_array( 'current-menu-item', $classes ) )
- $class_names .= ' active';
- // remove Font Awesome icon from classes array and save the icon
- // we will add the icon back in via a below so it aligns with
- // the menu item
- if ( in_array('fa', $classes)) {
- $key = array_search('fa', $classes);
- $icon = $classes[$key + 1];
- $class_names = str_replace($classes[$key+1], '', $class_names);
- $class_names = str_replace($classes[$key], '', $class_names);
- }
+class WP_Bootstrap_Navwalker extends Walker_Nav_Menu {
+ /**
+ * The starting level of the menu.
+ *
+ * @see Walker::start_lvl()
+ * @since 3.0.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param int $depth Depth of page. Used for padding.
+ * @param mixed $args Rest of arguments.
+ */
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
+ $indent = str_repeat( "\t", $depth );
+ $output .= "\n$indent ';
- $item_output .= $args->after;
- $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
- }
- }
- /**
- * Traverse elements to create list from elements.
- *
- * Display one element if the element doesn't have any children otherwise,
- * display the element and its children. Will only traverse up to the max
- * depth and no ignore elements under that depth.
- *
- * This method shouldn't be called directly, use the walk() method instead.
- *
- * @see Walker::start_el()
- * @since 2.5.0
- *
- * @param object $element Data object
- * @param array $children_elements List of elements to continue traversing.
- * @param int $max_depth Max depth to traverse.
- * @param int $depth Depth of current element.
- * @param array $args
- * @param string $output Passed by reference. Used to append additional content.
- * @return null Null on failure with no changes to parameters.
- */
- public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
- if ( ! $element )
- return;
- $id_field = $this->db_fields['id'];
- // Display this element.
- if ( is_object( $args[0] ) )
- $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] );
- parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
- }
- /**
- * Menu Fallback
- * =============
- * If this function is assigned to the wp_nav_menu's fallback_cb variable
- * and a manu has not been assigned to the theme location in the WordPress
- * menu manager the function with display nothing to a non-logged in user,
- * and will add a link to the WordPress menu manager if logged in as an admin.
- *
- * @param array $args passed from the wp_nav_menu function.
- *
- */
- public static function fallback( $args ) {
- if ( current_user_can( 'manage_options' ) ) {
- extract( $args );
- $fb_output = null;
- if ( $container ) {
- $fb_output = '<' . $container;
- if ( $container_class )
- $fb_output .= ' class="' . $container_class . '"';
- if ( $container_id )
- $fb_output .= ' id="' . $container_id . '"';
- $fb_output .= '>';
- }
- $fb_output .= '';
+ $atts = array();
+ $atts['title'] = ! empty( $item->title ) ? $item->title : '';
+ $atts['target'] = ! empty( $item->target ) ? $item->target : '';
+ $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
+ // If item has_children add atts to a.
+
+ if ( $args->has_children && $depth === 0 ) {
+ $atts['href'] = '#';
+ $atts['data-toggle'] = 'dropdown';
+ $atts['class'] = 'nav-link dropdown-toggle';
+ } else {
+ $atts['href'] = ! empty( $item->url ) ? $item->url : '';
+ $atts['class'] = 'nav-link';
+ }
+ $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
+ $attributes = '';
+ foreach ( $atts as $attr => $value ) {
+ if ( ! empty( $value ) ) {
+ $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
+ $attributes .= ' ' . $attr . '="' . $value . '"';
+ }
+ }
+ $item_output = $args->before;
+ // Font Awesome icons
+ if ( ! empty( $icon ) ) {
+ $item_output .= ' ';
+ } else {
+ $item_output .= '';
+ }
+ $item_output .= $args->link_before . apply_filters( 'the_title', $item->title,
+ $item->ID ) . $args->link_after;
+ $item_output .= ( $args->has_children && 0 === $depth ) ? ' ' : '';
+ $item_output .= $args->after;
+ $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
+ }
+ }
+
+ /**
+ * Traverse elements to create list from elements.
+ *
+ * Display one element if the element doesn't have any children otherwise,
+ * display the element and its children. Will only traverse up to the max
+ * depth and no ignore elements under that depth.
+ *
+ * This method shouldn't be called directly, use the walk() method instead.
+ *
+ * @see Walker::start_el()
+ * @since 2.5.0
+ *
+ * @param object $element Data object
+ * @param array $children_elements List of elements to continue traversing.
+ * @param int $max_depth Max depth to traverse.
+ * @param int $depth Depth of current element.
+ * @param array $args
+ * @param string $output Passed by reference. Used to append additional content.
+ *
+ * @return null Null on failure with no changes to parameters.
+ */
+ public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
+ if ( ! $element ) {
+ return;
+ }
+ $id_field = $this->db_fields['id'];
+ // Display this element.
+ if ( is_object( $args[0] ) ) {
+ $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] );
+ }
+ parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
+ }
+
+ /**
+ * Menu Fallback
+ * =============
+ * If this function is assigned to the wp_nav_menu's fallback_cb variable
+ * and a manu has not been assigned to the theme location in the WordPress
+ * menu manager the function with display nothing to a non-logged in user,
+ * and will add a link to the WordPress menu manager if logged in as an admin.
+ *
+ * @param array $args passed from the wp_nav_menu function.
+ *
+ */
+ public static function fallback( $args ) {
+ if ( current_user_can( 'manage_options' ) ) {
+ extract( $args );
+ $fb_output = null;
+ if ( $container ) {
+ $fb_output = '<' . $container;
+ if ( $container_class ) {
+ $fb_output .= ' class="' . $container_class . '"';
+ }
+ if ( $container_id ) {
+ $fb_output .= ' id="' . $container_id . '"';
+ }
+ $fb_output .= '>';
+ }
+ $fb_output .= ' ';
+ $fb_output .= '';
+ if ( $container ) {
+ $fb_output .= '' . $container . '>';
+ }
+ echo $fb_output;
+ }
+ }
}
diff --git a/inc/custom-comments.php b/inc/custom-comments.php
index 4526d323..b7659be8 100644
--- a/inc/custom-comments.php
+++ b/inc/custom-comments.php
@@ -1,30 +1,54 @@
'
';
+ } else {
+ $html .= 'col-md-12 content-area" id="primary">';
}
+ echo $html;
+ } elseif ( is_active_sidebar( 'right-sidebar' ) && is_active_sidebar( 'left-sidebar' ) ) {
+ $html = '
';
+
+ return $output;
}
-add_shortcode('gallery', 'shortcode_gallery');
+
+add_shortcode( 'gallery', 'shortcode_gallery' );
/**
* Add class="thumbnail img-thumbnail" to attachment items
+ *
+ * @param string $html markup.
+ *
+ * @return mixed
*/
-function attachment_link_class($html) {
- $html = str_replace('\n";
- }
- /**
- * @see Walker::start_el()
- * @since 3.0.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $item Menu item data object.
- * @param int $depth Depth of menu item. Used for padding.
- * @param int $current_page Menu item ID.
- * @param object $args
- */
- public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
- $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
- /**
- * Dividers, Headers or Disabled
- * =============================
- * Determine whether the item is a Divider, Header, Disabled or regular
- * menu item. To prevent errors we use the strcasecmp() function to so a
- * comparison that is not case sensitive. The strcasecmp() function returns
- * a 0 if the strings are equal.
- */
- if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) {
- $output .= $indent . '';
+ } else {
+ $html .= 'col-md-12 content-area" id="primary">';
+ }
+ echo $html;
}
-?>
+}
+
diff --git a/header.php b/header.php
index e16b3e4c..f6d371c6 100755
--- a/header.php
+++ b/header.php
@@ -60,7 +60,7 @@
'menu_class' => 'nav navbar-nav',
'fallback_cb' => '',
'menu_id' => 'main-menu',
- 'walker' => new wp_bootstrap_navwalker()
+ 'walker' => new WP_Bootstrap_Navwalker()
)
); ?>
diff --git a/inc/bootstrap-wp-gallery.php b/inc/bootstrap-wp-gallery.php
index 6ccc70c7..b650c79c 100644
--- a/inc/bootstrap-wp-gallery.php
+++ b/inc/bootstrap-wp-gallery.php
@@ -1,105 +1,139 @@
'ASC',
- 'orderby' => 'menu_order ID',
- 'id' => $post->ID,
- 'itemtag' => '',
- 'icontag' => '',
- 'captiontag' => '',
- 'columns' => 3,
- 'size' => 'thumbnail',
- 'include' => '',
- 'exclude' => '',
- 'link' => ''
- ], $attr));
- $id = intval($id);
- $columns = (12 % $columns == 0) ? $columns : 3;
- $grid = sprintf('col-sm-%1$s col-lg-%1$s', 12 / $columns);
- if ($order === 'RAND') {
- $orderby = 'none';
- }
- if (!empty($include)) {
- $_attachments = get_posts(['include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby]);
- $attachments = [];
- foreach ($_attachments as $key => $val) {
- $attachments[$val->ID] = $_attachments[$key];
- }
- } elseif (!empty($exclude)) {
- $attachments = get_children(['post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby]);
- } else {
- $attachments = get_children(['post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby]);
- }
- if (empty($attachments)) {
- return '';
- }
- if (is_feed()) {
- $output = "\n";
- foreach ($attachments as $att_id => $attachment) {
- $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
- }
- return $output;
- }
- $unique = (get_query_var('page')) ? $instance . '-p' . get_query_var('page') : $instance;
- $output = '
';
- return $output;
+/*
+ * Replace with custom shortcode
+ */
+function shortcode_gallery( $attr ) {
+ $post = get_post();
+ static $instance = 0;
+ $instance ++;
+ if ( ! empty( $attr['ids'] ) ) {
+ if ( empty( $attr['orderby'] ) ) {
+ $attr['orderby'] = 'post__in';
+ }
+ $attr['include'] = $attr['ids'];
+ }
+ $output = apply_filters( 'post_gallery', '', $attr );
+ if ( $output != '' ) {
+ return $output;
+ }
+ if ( isset( $attr['orderby'] ) ) {
+ $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
+ if ( ! $attr['orderby'] ) {
+ unset( $attr['orderby'] );
+ }
+ }
+ extract( shortcode_atts( [
+ 'order' => 'ASC',
+ 'orderby' => 'menu_order ID',
+ 'id' => $post->ID,
+ 'itemtag' => '',
+ 'icontag' => '',
+ 'captiontag' => '',
+ 'columns' => 3,
+ 'size' => 'thumbnail',
+ 'include' => '',
+ 'exclude' => '',
+ 'link' => '',
+ ], $attr ) );
+ $id = intval( $id );
+ $columns = ( 12 % $columns == 0 ) ? $columns : 3;
+ $grid = sprintf( 'col-sm-%1$s col-lg-%1$s', 12 / $columns );
+ if ( $order === 'RAND' ) {
+ $orderby = 'none';
+ }
+ if ( ! empty( $include ) ) {
+ $_attachments = get_posts( [ 'include' => $include,
+ 'post_status' => 'inherit',
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'order' => $order,
+ 'orderby' => $orderby
+ ] );
+ $attachments = [];
+ foreach ( $_attachments as $key => $val ) {
+ $attachments[ $val->ID ] = $_attachments[ $key ];
+ }
+ } elseif ( ! empty( $exclude ) ) {
+ $attachments = get_children( [ 'post_parent' => $id,
+ 'exclude' => $exclude,
+ 'post_status' => 'inherit',
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'order' => $order,
+ 'orderby' => $orderby
+ ] );
+ } else {
+ $attachments = get_children( [ 'post_parent' => $id,
+ 'post_status' => 'inherit',
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'order' => $order,
+ 'orderby' => $orderby
+ ] );
+ }
+ if ( empty( $attachments ) ) {
+ return '';
+ }
+ if ( is_feed() ) {
+ $output = "\n";
+ foreach ( $attachments as $att_id => $attachment ) {
+ $output .= wp_get_attachment_link( $att_id, $size, true ) . "\n";
+ }
+
+ return $output;
+ }
+ $unique = ( get_query_var( 'page' ) ) ? $instance . '-p' . get_query_var( 'page' ) : $instance;
+ $output = '';
- $i = 0;
- foreach ($attachments as $id => $attachment) {
- switch($link) {
- case 'file':
- $image = wp_get_attachment_link($id, $size, false, false);
- break;
- case 'none':
- $image = wp_get_attachment_image($id, $size, false, ['class' => 'thumbnail img-thumbnail']);
- break;
- default:
- $image = wp_get_attachment_link($id, $size, true, false);
- break;
- }
- $output .= ($i % $columns == 0) ? '
' : '';
- $output .= '' : '';
- $output .= '
' : '';
- }
- $output .= ($i % $columns != 0 ) ? '' . $image;
- if (trim($attachment->post_excerpt)) {
- $output .= '
';
- $i++;
- $output .= ($i % $columns == 0) ? '' . wptexturize($attachment->post_excerpt) . '
';
- }
- $output .= '';
+ $i = 0;
+ foreach ( $attachments as $id => $attachment ) {
+ switch ( $link ) {
+ case 'file':
+ $image = wp_get_attachment_link( $id, $size, false, false );
+ break;
+ case 'none':
+ $image = wp_get_attachment_image( $id, $size, false, [ 'class' => 'thumbnail img-thumbnail' ] );
+ break;
+ default:
+ $image = wp_get_attachment_link( $id, $size, true, false );
+ break;
+ }
+ $output .= ( $i % $columns == 0 ) ? '
' : '';
+ $output .= '' : '';
+ $output .= '
' : '';
+ }
+ $output .= ( $i % $columns != 0 ) ? '' . $image;
+ if ( trim( $attachment->post_excerpt ) ) {
+ $output .= '
';
+ $i ++;
+ $output .= ( $i % $columns == 0 ) ? '' . wptexturize( $attachment->post_excerpt ) . '
';
+ }
+ $output .= '- \n";
+ }
- $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
- $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
- $id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
- $output .= $indent . '
- '; - $atts = array(); - $atts['title'] = ! empty( $item->title ) ? $item->title : ''; - $atts['target'] = ! empty( $item->target ) ? $item->target : ''; - $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; - // If item has_children add atts to a. + /** + * Open element. + * + * @see Walker::start_el() + * @since 3.0.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param mixed $args Rest arguments. + * @param int $id Element's ID. + */ + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; + /** + * Dividers, Headers or Disabled + * ============================= + * Determine whether the item is a Divider, Header, Disabled or regular + * menu item. To prevent errors we use the strcasecmp() function to so a + * comparison that is not case sensitive. The strcasecmp() function returns + * a 0 if the strings are equal. + */ + if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) { + $output .= $indent . '
- '; + } else if ( strcasecmp( $item->title, 'divider' ) == 0 && $depth === 1 ) { + $output .= $indent . '
- '; + } else if ( strcasecmp( $item->attr_title, 'dropdown-header' ) == 0 && $depth === 1 ) { + $output .= $indent . '
- ' . esc_attr( $item->title ); + } else if ( strcasecmp( $item->attr_title, 'disabled' ) == 0 ) { + $output .= $indent . '
- ' . esc_attr( $item->title ) . ''; + } else { + $class_names = $value = ''; + $classes = empty( $item->classes ) ? array() : (array) $item->classes; + $classes[] = 'nav-item menu-item-' . $item->ID; + $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) ); + /* + if ( $args->has_children ) + $class_names .= ' dropdown'; + */ + if ( $args->has_children && $depth === 0 ) { + $class_names .= ' dropdown'; + } elseif ( $args->has_children && $depth > 0 ) { + $class_names .= ' dropdown-submenu'; + } + if ( in_array( 'current-menu-item', $classes ) ) { + $class_names .= ' active'; + } + // remove Font Awesome icon from classes array and save the icon + // we will add the icon back in via a below so it aligns with + // the menu item + if ( in_array( 'fa', $classes ) ) { + $key = array_search( 'fa', $classes ); + $icon = $classes[ $key + 1 ]; + $class_names = str_replace( $classes[ $key + 1 ], '', $class_names ); + $class_names = str_replace( $classes[ $key ], '', $class_names ); + } - if ( $args->has_children && $depth === 0 ) { - $atts['href'] = '#'; - $atts['data-toggle'] = 'dropdown'; - $atts['class'] = 'nav-link dropdown-toggle'; - } else { - $atts['href'] = ! empty( $item->url ) ? $item->url : ''; - $atts['class'] = 'nav-link'; - } - $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); - $attributes = ''; - foreach ( $atts as $attr => $value ) { - if ( ! empty( $value ) ) { - $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); - $attributes .= ' ' . $attr . '="' . $value . '"'; - } - } - $item_output = $args->before; - // Font Awesome icons - if ( ! empty( $icon ) ) - $item_output .= ' '; - else - $item_output .= ''; - $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; - $item_output .= ( $args->has_children && 0 === $depth ) ? ' ' : '
- Add a menu';
- $fb_output .= '
- Add a menu
' . ' ' .
- '
',
- 'email' => ' ' .
- '
',
- 'url' => ' ' .
- '
',
- );
- return $fields;
- }
+// Comments form.
+add_filter( 'comment_form_default_fields', 'bootstrap3_comment_form_fields' );
- add_filter( 'comment_form_defaults', 'bootstrap3_comment_form' );
- function bootstrap3_comment_form( $args ) {
- $args['comment_field'] = '
+/**
+ * Creates the comments form.
+ *
+ * @param string $fields Form fields.
+ *
+ * @return array
+ */
+function bootstrap3_comment_form_fields( $fields ) {
+ $commenter = wp_get_current_commenter();
+ $req = get_option( 'require_name_email' );
+ $aria_req = ( $req ? " aria-required='true'" : '' );
+ $html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0;
+ $fields = array(
+ 'author' => '
';
- $args['class_submit'] = 'btn btn-secondary'; // since WP 4.1
- return $args;
- }
+ $args['class_submit'] = 'btn btn-secondary'; // since WP 4.1.
+ return $args;
+}
diff --git a/inc/customizer.php b/inc/customizer.php
index 28cbbe6d..b3a260a5 100644
--- a/inc/customizer.php
+++ b/inc/customizer.php
@@ -1,6 +1,6 @@
get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
@@ -21,39 +26,44 @@ if ( ! function_exists( 'understrap_customize_register' ) ) {
add_action( 'customize_register', 'understrap_customize_register' );
if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
+ /**
+ * Register individual settings through customizer's API.
+ *
+ * @param object $wp_customize Customizer reference.
+ */
function understrap_theme_customize_register( $wp_customize ) {
$wp_customize->add_section( 'understrap_theme_slider_options', array(
- 'title' => __( 'Slider Settings', 'understrap' )
+ 'title' => __( 'Slider Settings', 'understrap' ),
) );
$wp_customize->add_setting( 'understrap_theme_slider_count_setting', array(
'default' => '1',
- 'sanitize_callback' => 'absint'
+ 'sanitize_callback' => 'absint',
) );
$wp_customize->add_control( 'understrap_theme_slider_count', array(
'label' => __( 'Number of slides displaying at once', 'understrap' ),
'section' => 'understrap_theme_slider_options',
'type' => 'text',
- 'settings' => 'understrap_theme_slider_count_setting'
+ 'settings' => 'understrap_theme_slider_count_setting',
) );
$wp_customize->add_setting( 'understrap_theme_slider_time_setting', array(
'default' => '5000',
- 'sanitize_callback' => 'absint'
+ 'sanitize_callback' => 'absint',
) );
$wp_customize->add_control( 'understrap_theme_slider_time', array(
'label' => __( 'Slider Time (in ms)', 'understrap' ),
'section' => 'understrap_theme_slider_options',
'type' => 'text',
- 'settings' => 'understrap_theme_slider_time_setting'
+ 'settings' => 'understrap_theme_slider_time_setting',
) );
$wp_customize->add_setting( 'understrap_theme_slider_loop_setting', array(
'default' => 'true',
- 'sanitize_callback' => 'esc_textarea'
+ 'sanitize_callback' => 'esc_textarea',
) );
$wp_customize->add_control( 'understrap_theme_loop', array(
@@ -64,10 +74,10 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
'true' => 'yes',
'false' => 'no',
),
- 'settings' => 'understrap_theme_slider_loop_setting'
+ 'settings' => 'understrap_theme_slider_loop_setting',
) );
- // Theme layout settings
+ // Theme layout settings.
$wp_customize->add_section( 'understrap_theme_layout_options', array(
'title' => __( 'Theme Layout Settings', 'understrap' ),
'capability' => 'edit_theme_options',
@@ -76,10 +86,10 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
) );
$wp_customize->add_setting( 'understrap_container_type', array(
- 'default' => 'container',
- 'type' => 'theme_mod',
+ 'default' => 'container',
+ 'type' => 'theme_mod',
'sanitize_callback' => 'esc_textarea',
- 'capability' => 'edit_theme_options'
+ 'capability' => 'edit_theme_options',
) );
$wp_customize->add_control(
@@ -100,10 +110,10 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
) );
$wp_customize->add_setting( 'understrap_sidebar_position', array(
- 'default' => 'right',
- 'type' => 'theme_mod',
+ 'default' => 'right',
+ 'type' => 'theme_mod',
'sanitize_callback' => 'esc_textarea',
- 'capability' => 'edit_theme_options',
+ 'capability' => 'edit_theme_options',
) );
$wp_customize->add_control(
@@ -111,7 +121,8 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
$wp_customize,
'understrap_sidebar_position', array(
'label' => __( 'Sidebar Positioning', 'understrap' ),
- 'description' => __( "Set sidebar's position. Can either be: right, left, both or none", 'understrap' ),
+ 'description' => __( "Set sidebar's position. Can either be: right, left, both or none",
+ 'understrap' ),
'section' => 'understrap_theme_layout_options',
'settings' => 'understrap_sidebar_position',
'type' => 'select',
@@ -125,12 +136,12 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
)
) );
- // How to display posts index page (home.php)
+ // How to display posts index page (home.php).
$wp_customize->add_setting( 'understrap_posts_index_style', array(
- 'default' => 'default',
- 'type' => 'theme_mod',
+ 'default' => 'default',
+ 'type' => 'theme_mod',
'sanitize_callback' => 'esc_textarea',
- 'capability' => 'edit_theme_options',
+ 'capability' => 'edit_theme_options',
) );
$wp_customize->add_control(
@@ -138,12 +149,12 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
$wp_customize,
'understrap_posts_index_style', array(
'label' => __( 'Posts Index Style', 'understrap' ),
- 'description' => __( "Choose how to display latest posts", 'understrap' ),
+ 'description' => __( 'Choose how to display latest posts', 'understrap' ),
'section' => 'understrap_theme_layout_options',
'settings' => 'understrap_posts_index_style',
'type' => 'select',
'choices' => array(
- 'default' => __( 'Default', 'understrap' ),
+ 'default' => __( 'Default', 'understrap' ),
'masonry' => __( 'Masonry', 'understrap' ),
),
'priority' => '30',
@@ -159,7 +170,8 @@ add_action( 'customize_register', 'understrap_theme_customize_register' );
*/
if ( ! function_exists( 'understrap_customize_preview_js' ) ) {
function understrap_customize_preview_js() {
- wp_enqueue_script( 'understrap_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );
+ wp_enqueue_script( 'understrap_customizer', get_template_directory_uri() . '/js/customizer.js',
+ array( 'customize-preview' ), '20130508', true );
}
}
add_action( 'customize_preview_init', 'understrap_customize_preview_js' );
' . __( 'Name',
+ 'understrap' ) . ( $req ? ' *' : '' ) . ' ' .
+ '
',
+ 'email' => ' ' .
+ '
',
+ 'url' => ' ' .
+ '
',
+ );
+
+ return $fields;
+}
+
+add_filter( 'comment_form_defaults', 'bootstrap3_comment_form' );
+
+/**
+ * Builds the form.
+ *
+ * @param string $args Arguments for form's fields.
+ *
+ * @return mixed
+ */
+function bootstrap3_comment_form( $args ) {
+ $args['comment_field'] = '