for posts and comments. add_theme_support('automatic-feed-links'); // register menu register_nav_menus(array( 'primary' => __('Top Header Menu', 'business-consultant'), )); // Featured image support add_theme_support('post-thumbnails'); add_theme_support( 'custom-logo', array( 'height' => 160, 'width' => 45, 'flex-height' => true, 'flex-width' => true, 'priority' => 11, 'header-text' => array( 'img-responsive', 'site-description' ), ) ); add_image_size('business_consultant_thumbnail_image', 840, 560, true); add_image_size('business_consultant_blog_thumbnail_image', 760, 500, true); add_theme_support( 'custom-header'); // Switch default core markup for search form, comment form, and commen, to output valid HTML5. add_theme_support('html5', array( 'search-form', 'comment-form', 'comment-list', )); // This theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); /* slug setup */ add_theme_support('title-tag'); } endif; // business_consultant_setup add_action('after_setup_theme', 'business_consultant_setup'); add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2); function special_nav_class($classes, $item){ if( in_array('current-menu-item', $classes) ){ $classes[] = 'active '; } return $classes; } /*WooCommerce*/ remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); add_action('woocommerce_before_main_content', 'business_consultant_wrapper_start', 10); add_action('woocommerce_after_main_content', 'business_consultant_wrapper_end', 10); function business_consultant_wrapper_start() { echo '
'; } function business_consultant_wrapper_end() { echo '
'; } /**/ add_action( 'after_setup_theme', 'woocommerce_support' ); function woocommerce_support() { add_theme_support( 'woocommerce' ); } function business_consultant_excerpt_length( $length ) { if(is_admin()){ return $length; } return 30; } add_filter( 'excerpt_length', 'business_consultant_excerpt_length', 999 ); //clearfix function business_consultant_bootstrap_clearfix( $i, $args = array(), $element = 'div', $grid = 12 ) { $performFor = array(); $clearfix = ''; if ( isset( $args['xs'] ) && is_int( $args['xs'] ) ) { $performFor[] = 'xs'; } if ( isset( $args['sm'] ) && is_int( $args['sm'] ) ) { $performFor[] = 'sm'; } if ( isset( $args['md'] ) && is_int( $args['md'] ) ) { $performFor[] = 'md'; } if ( isset( $args['lg'] ) && is_int( $args['lg'] ) ) { $performFor[] = 'lg'; } foreach ( $performFor as $v ) { $modulus = $grid / $args[ $v ]; $clearfix .= ( $i > 0 && $i % $modulus == 0 ? ' <'.$element.' class="clearfix visible-' . $v . '">' : '' ); } return $clearfix; } require get_template_directory() . '/functions/theme-default-setup.php';