• Resolved shungshan

    (@shungshan)


    I would like to show both the site title and the logo side by side.
    I messed around with the files and found this piece of code and I would like to modify it to show the title and logo.

    if ( ! function_exists( 'storefront_site_title_or_logo' ) ) {
    	/**
    	 * Display the site title or logo
    	 *
    	 * @since 2.1.0
    	 * @param bool $echo Echo the string or return it.
    	 * @return string
    	 */
    	function storefront_site_title_or_logo( $echo = true ) {
    		if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
    			$logo = get_custom_logo();
    			$html = is_home() ? '<h1 class="logo">' . $logo . '</h1>' : $logo;
    		} else {
    			$tag = is_home() ? 'h1' : 'div';
    
    			$html = '<' . esc_attr( $tag ) . ' class="beta site-title"><a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . esc_html( get_bloginfo( 'name' ) ) . '</a></' . esc_attr( $tag ) . '>';
    
    			if ( '' !== get_bloginfo( 'description' ) ) {
    				$html .= '<p class="site-description">' . esc_html( get_bloginfo( 'description', 'display' ) ) . '</p>';
    			}
    		}
    
    		if ( ! $echo ) {
    			return $html;
    		}
    
    		echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    	}
    }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Show Logo and Title’ is closed to new replies.