__( 'Primary Menu', 'business-a' ), 'footer' => __( 'Footer Menu', 'business-a' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* * Custom logo * Add theme support for custom logo. https://codex.wordpress.org/Theme_Logo */ $args = array( 'flex-width' => true, ); add_theme_support( 'custom-logo', $args ); // Add custom header support. https://codex.wordpress.org/Custom_Headers $args = array( 'default-image' => get_template_directory_uri() . '/images/seprator_back.jpg', 'header-text' => false, 'width' => 1400, 'height' => 600, 'flex-width' => true, 'flex-height' => true, ); add_theme_support( 'custom-header', $args ); $header_image = array( 'library' => array( 'url' => get_template_directory_uri() . '/images/seprator_back.jpg', 'thumbnail_url' => get_template_directory_uri() . '/images/seprator_back.jpg', 'description' => 'Library Ceiling', ), ); register_default_headers( $header_image ); // Add custom background support. https://codex.wordpress.org/Custom_Backgrounds add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', ) ); /* * woocommerce support */ add_theme_support( 'woocommerce' ); add_editor_style( array( 'css/editor-style.css', get_template_directory_uri() ) ); add_theme_support( 'recommend-plugins', array( 'contact-form-7' => array( 'name' => esc_html__( 'Contact Form 7', 'business-a' ), 'desc' => esc_html__( 'This is also recommended that you install the contact form plugin to show contact form on Front Page contact section and Contact custom page template.', 'business-a' ), 'active_filename' => 'contact-form-7/wp-contact-form-7.php', ), ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); } endif; // business_a_setup add_action( 'after_setup_theme', 'business_a_setup' ); /** * Save activation time. * * @access public */ function business_a_time_activated() { update_option( 'business_time_activated', time() ); } add_action( 'after_switch_theme', 'business_a_time_activated' ); /** * Check if 12 hours have passed since theme was activated. * * @access public * @return bool */ function business_a_ready_for_upsells() { $activation_time = get_option( 'business_time_activated' ); if ( ! empty( $activation_time ) ) { $current_time = time(); $time_difference = 43200; if ( $current_time >= $activation_time + $time_difference ) { return true; } else { return false; } } return true; } // wp title function business_a_title( $title, $sep ) { global $paged, $page; if( is_home() ){ return $title; } if ( is_feed() ) return $title; // Add the site name. $title .= esc_html( get_bloginfo( 'name' ) ); // Add the site description for the home/front page. $site_description = esc_html( get_bloginfo( 'description' ) ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( _e( 'Page', 'business-a' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'business_a_title', 10,2 ); /** * Add appropriate classes to body tag. * */ function business_a_body_classes( $classes ) { $business_obj = new business_a_settings_array(); $option = wp_parse_args( get_option( 'business_option', array() ), $business_obj->default_data() ); if ( $option['layout'] == true ) { $classes[] = 'boxed'; } return $classes; } add_filter( 'body_class', 'business_a_body_classes' );