esc_html__( 'Top Header Menu', 'ultra-lite-blog' ),
) );
}
}
add_action( 'after_setup_theme', 'ultra_lite_blog_setup' );
if( !function_exists( 'ultra_lite_blog_header_menu_action' ) ) {
/**
* Hook - Header Menu
*
* @since 1.0.0
*/
function ultra_lite_blog_header_menu_action() {
if( has_nav_menu( 'header-menu' ) ) :
?>
'header-menu',
'container' => '',
'depth' => 1,
) );
?>
post_content;
$word_count = str_word_count( strip_tags( $content ) );
$per_min_words = absint( 240 );
$total_time = round( ($word_count)/($per_min_words) );
if( $total_time > 1 ) {
$time_unit = 'minutes';
} else {
$time_unit = 'minute';
}
/* translators: 1: Total Time 2: Time Unit */
printf( esc_html__( 'Read Time: %1$s %2$s', 'ultra-lite-blog' ), $total_time, $time_unit );
}
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function ultra_lite_blog_customize_register( $wp_customize ) {
// Option - Enable Child Header
$wp_customize->add_setting( 'ultra_lite_blog_enable_child_header', array(
'sanitize_callback' => 'viable_blog_sanitize_checkbox',
'default' => 1,
) );
$wp_customize->add_control( 'ultra_lite_blog_enable_child_header', array(
'label' => esc_html__( 'Enable Child Header', 'ultra-lite-blog' ),
'description' => esc_html__( 'On enabling this option, header of parent theme will not be shown.', 'ultra-lite-blog' ),
'section' => 'viable_blog_header_options',
'type' => 'checkbox',
) );
// Option - Enable Child Banner
$wp_customize->add_setting( 'ultra_lite_blog_enable_child_banner', array(
'sanitize_callback' => 'viable_blog_sanitize_checkbox',
'default' => 1,
) );
$wp_customize->add_control( 'ultra_lite_blog_enable_child_banner', array(
'label' => esc_html__( 'Enable Child Banner', 'ultra-lite-blog' ),
'description' => esc_html__( 'On enabling this option, banner of parent theme will not be shown.', 'ultra-lite-blog' ),
'section' => 'viable_blog_banner_options',
'type' => 'checkbox',
'active_callback' => 'ultra_lite_blog_is_banner_active',
) );
}
add_action( 'customize_register', 'ultra_lite_blog_customize_register', 20 );
/**
* Active callback function for child banner
*/
if( ! function_exists( 'ultra_lite_blog_is_banner_active' ) ) {
function ultra_lite_blog_is_banner_active( $control ) {
if( $control->manager->get_setting( 'viable_blog_enable_banner' )->value() == 1 ) {
return true;
} else {
return false;
}
}
}
/**
* Load Template functions
*/
require get_stylesheet_directory() . '/inc/functions/template-functions.php';
/**
* Load Extras
*/
require get_stylesheet_directory() . '/inc/functions/extras.php';