tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); /* * Enable theme support for Post Formats. * * @link https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'menu-1' => esc_html__( 'Primary', 'algori-shop' ), 'menu-2' => esc_html__( 'Footer', 'algori-shop' ), ) ); /* * 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', 'gallery', 'caption', ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); /** * Enable gutenberg block styles on the front-end. */ add_theme_support( 'wp-block-styles' ); /** * Enable gutenberg wide alignment. */ add_theme_support( 'align-wide' ); /** * Enable gutenberg responsive embeds. */ add_theme_support( 'responsive-embeds' ); /** * Add custom link class navbar-brand to generated custom logo image link. */ add_filter('get_custom_logo', 'algori_shop_change_logo_class'); function algori_shop_change_logo_class ($html){ $html = str_replace('custom-logo-link', 'custom-logo-link navbar-brand', $html); return $html; } /** * Display custom logo image if uploaded otherwise show text logo. */ function algori_shop_display_logo(){ if( function_exists('the_custom_logo') ){ // check if the_custom_logo() is supported i.e WP 4.5 and above if( has_custom_logo() ){ // check if logo image has been set the_custom_logo(); // display set logo image }else{ // display text logo // display H1 text logo if index page if ( is_front_page() && is_home() ) { echo '
text logo if not index page echo '
'; echo bloginfo( 'name' ); echo '
'; } } } } /** * Display algori shop custom comments format HTML Output. */ function algori_shop_comments_format($comment, $args, $depth){ echo '