for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme uses wp_nav_menu() in two locations. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 672, 372, true ); add_image_size( 'booster-full-width', 1038, 576, true ); add_theme_support( "title-tag" ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Top primary menu', 'booster' ), 'secondary' => __( 'Footer Secondary menu', 'booster' ), ) ); // Add theme support for Custom Logo. add_theme_support( 'custom-logo', array( 'width' => 250, 'height' => 250, 'flex-width' => true, 'flex-height' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', ) ); add_theme_support( 'custom-background', apply_filters( 'booster_custom_background_args', array( 'default-color' => 'f5f5f5', ) ) ); // Add support for featured content. add_theme_support( 'featured-content', array( 'featured_content_filter' => 'booster_get_featured_posts', 'max_posts' => 6, ) ); // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); } endif; // booster_setup add_action( 'after_setup_theme', 'booster_setup' ); // Implement Custom Header features. require get_template_directory() . '/inc/custom-header.php'; /** * Add default menu style if menu is not set from the backend. */ function booster_add_menuid ($page_markup) { preg_match('/^
/i', $page_markup, $matches); $booster_divclass = ''; if(!empty($matches)) { $booster_divclass = $matches[1]; } $booster_toreplace = array('
', '
'); $booster_replace = array(''); $booster_new_markup = str_replace($booster_toreplace,$booster_replace, $page_markup); $booster_new_markup= preg_replace('/
'; } else { echo '
' . esc_html__('Home', 'booster') . ' '; if (is_category()) { $booster_thisCat = get_category(get_query_var('cat'), false); if ($booster_thisCat->parent != 0) echo esc_html(get_category_parents($booster_thisCat->parent, TRUE, ' ')); echo '/ '.esc_html__('Archive by category', 'booster') . ' " ' . single_cat_title('', false) . ' "'; } elseif (is_search()) { echo '/ '.esc_html__('Search Results For ', 'booster') . ' " ' . get_search_query() . ' "'; } elseif (is_day()) { echo '/ '.'' . esc_html(get_the_time('Y')) . ' '; echo '/ '.'' . esc_html(get_the_time('F') ). ' '; echo '/ '.esc_html(get_the_time('d')).''; } elseif (is_month()) { echo '/ '.'' . esc_html(get_the_time('Y')) . ' '; echo '/ '.esc_html(get_the_time('F')).'' ; } elseif (is_year()) { echo '/ '.esc_html(get_the_time('Y')).'' ; } elseif (is_single() && !is_attachment()) { if (get_post_type() != 'post') { $booster_post_type = get_post_type_object(get_post_type()); $booster_slug = $booster_post_type->rewrite; echo '' . esc_html($booster_post_type->labels->singular_name) . ''; if ($booster_showcurrent == 1) echo esc_html(get_the_title()) ; } else { $booster_cat = get_the_category(); $booster_cat = $booster_cat[0]; $booster_cats = get_category_parents($booster_cat, TRUE, ' '); if ($booster_showcurrent == 0) $booster_cats = preg_replace("#^(.+)\s\s$#", "$1", $booster_cats); echo '/ '.$booster_cats; if ($booster_showcurrent == 1) echo '/ '.esc_html(get_the_title()).''; } } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) { $booster_post_type = get_post_type_object(get_post_type()); echo esc_html($booster_post_type->labels->singular_name ); } elseif (is_attachment()) { $booster_parent = get_post($post->post_parent); $booster_cat = get_the_category($booster_parent->ID); $booster_cat = $booster_cat[0]; echo esc_html(get_category_parents($booster_cat, TRUE, ' ')); echo '' . esc_html($booster_parent->post_title) . ''; if ($booster_showcurrent == 1) echo esc_html(get_the_title()); } elseif (is_page() && !$post->post_parent) { if ($booster_showcurrent == 1) echo '/ '.esc_html(get_the_title()).''; } elseif (is_page() && $post->post_parent) { $booster_parent_id = $post->post_parent; $booster_breadcrumbs = array(); while ($booster_parent_id) { $booster_page = get_page($booster_parent_id); $booster_breadcrumbs[] = '' . get_the_title($booster_page->ID) . ''; $booster_parent_id = $booster_page->post_parent; } $booster_breadcrumbs = array_reverse($booster_breadcrumbs); for ($booster_i = 0; $booster_i < count($booster_breadcrumbs); $booster_i++) { echo '/ '.$booster_breadcrumbs[$booster_i]; if ($booster_i != count($booster_breadcrumbs) - 1) echo ' '; } if ($booster_showcurrent == 1) echo ' / '.get_the_title().''; } elseif (is_tag()) { echo ' / '.esc_html__('Posts tagged', 'booster') . ' " ' . esc_html(single_tag_title('', false)) . ' "'; } elseif (is_author()) { global $author; $booster_userdata = get_userdata($author); echo ' / '.esc_html__('Articles Published by', 'booster') . ' " ' . esc_html($booster_userdata->display_name ). ' "'; } elseif (is_404()) { echo ' / '.esc_html__('Error 404', 'booster') ; } if (get_query_var('paged')) { if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ' ('; echo esc_html__('Page', 'booster') . ' ' . esc_html(get_query_var('paged')); if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ')'; } echo '
'; } } // end booster_custom_breadcrumbs() /** * Set up post entry meta. * * Meta information for current post: categories, tags, permalink, author, and date. **/ function booster_entry_meta() { $booster_category_list = get_the_category_list() ? ' '. get_the_category_list(', ').' ' :''; $booster_tag_list = get_the_tag_list('', ', ' ); $booster_date = sprintf( '', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $booster_author = sprintf( '%3$s', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), /* translators: 1: author name */ esc_attr( sprintf( __( 'View all posts by %s', 'booster' ), get_the_author() ) ), get_the_author() ); if ( $booster_tag_list ) { /* translators: 1: category, 2: date, 3: author name, 4: comment number */ $booster_utility_text = esc_html( 'Posted in : %1$s on %3$s by : %4$s %2$s Comments: '.get_comments_number(), 'booster' ); } elseif ( $booster_category_list ) { /* translators: 1: category, 2: date, 3: author name, 4: comment number */ $booster_utility_text = esc_html( 'Posted in : %1$s on %3$s by : %4$s %2$s Comments: '.get_comments_number(), 'booster' ); } else { /* translators: 1: date, 2: author name, 3: comment number */ $booster_utility_text = esc_html( 'Posted on : %3$s by : %4$s %2$s Comments: '.get_comments_number(), 'booster' ); } printf( $booster_utility_text, $booster_category_list, $booster_tag_list, $booster_date, $booster_author ); } if ( ! function_exists( 'booster_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own booster_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * */ function booster_comment( $comment, $booster_args, $depth ) { /*$GLOBALS['comment'] = $comment;*/ switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • comment_approved==1) { global $post; ?>
  • id="li-comment-" class="commentlist">
    %1$s', get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? '' . esc_html( 'Post author ', 'booster' ) . '' : '' ); echo ' '.get_comment_date().''; echo ''.comment_reply_link( array_merge( $booster_args, array( 'reply_text' => __( 'Reply', 'booster' ), 'after' => '', 'depth' => $depth, 'max_depth' => $booster_args['max_depth'] ) ) ).''; ?>
    '.__('Read more','booster').''; } add_filter( 'excerpt_more', 'booster_read_more' ); add_filter( 'comment_form_default_fields', 'booster_comment_placeholders' ); /** * Change default fields, add placeholder and change type attributes. * * @param array $fields * @return array */ function booster_comment_placeholders( $fields ) { $fields['author'] = str_replace( '', ''. _x( 'Comment', 'comment form placeholder', 'booster' ) . ''. '', $fields['comment_field'] ); return $fields; } /*** Theme Customizer Option ***/ require_once('inc/theme-customization.php'); ?>