How do I add a logo to my website?

I would like to know how to do add a logo to my website, before the site title.

html ?php language_attributes(); ?

head
meta charset="?php bloginfo( 'charset' ); ?" /
meta name="viewport" content="width=device-width, initial-scale=1"
link rel="profile" href="http://gmpg.org/xfn/11" /
link rel="pingback" href="?php bloginfo( 'pingback_url' ); ?" /

?php /* Embeds HTML5shiv to support HTML5 elements in older IE versions plus CSS Backgrounds */ ?
!--[if lt IE 9]
script src="?php echo get_template_directory_uri(); ?/js/html5shiv.min.js" type="text/javascript"/script
![endif]--
?php wp_head(); ?
/head

body ?php body_class(); ?

?php // Get Theme Options from Database
    $theme_options = smartline_theme_options();
?

div id="wrapper" class="hfeed"

    div id="header-wrap"

        ?php // Display Top Navigation
        if ( has_nav_menu( 'secondary' ) ) : ?

        nav id="topnav" class="clearfix" role="navigation"
            h5 id="topnav-icon"?php _e('Menu', 'smartline-lite'); ?/h5
            ?php wp_nav_menu(  array(
                'theme_location' = 'secondary', 
                'container' = false, 
                'menu_id' = 'topnav-menu', 
                'fallback_cb' = '', 
                'depth' = 1)
            );
            ?
        /nav

        ?php endif; ?

        header id="header" class="clearfix" role="banner"

            div id="logo" class="clearfix"

                ?php do_action('smartline_site_title'); ?

                ?php // Display Tagline on header if activated
                if ( isset($theme_options['header_tagline']) and $theme_options['header_tagline'] == true ) : ?            
                h2 class="site-description"?php echo bloginfo('description'); ?/h2
                ?php endif; ?

            /div

            div id="header-content" class="clearfix"
                ?php get_template_part('inc/header-content'); ?
            /div

        /header

    /div

    div id="navi-wrap"

        nav id="mainnav" class="clearfix" role="navigation"
            h4 id="mainnav-icon"?php _e('Menu', 'smartline-lite'); ?/h4
            ?php // Display Main Navigation
                wp_nav_menu( array(
                    'theme_location' = 'primary', 
                    'container' = false, 
                    'menu_id' = 'mainnav-menu', 
                    'echo' = true, 
                    'fallback_cb' = 'smartline_default_menu')
                );
            ?
        /nav

    /div

    ?php // Display Custom Header Image
        smartline_display_custom_header(); ?

Topic logo wp-head Wordpress

Category Web


Two Options, either define the url or link your defined custom logo from the theme settings.

<img src="<?php bloginfo('template_directory');?>/images/menuLogo.png">
<?php the_custom_logo(); ?>

https://developer.wordpress.org/reference/functions/the_custom_logo/ https://developer.wordpress.org/reference/functions/bloginfo/


Navigate to Smartline Lite: header.php file and change the below given code. let me know if it works ....

   <div id="logo" class="clearfix">

        <?php do_action('smartline_site_title'); ?>
<img src="image location" alt="alt title" height="auto" width="auto">

        <?php // Display Tagline on header if activated
        if ( isset($theme_options['header_tagline']) and $theme_options['header_tagline'] == true ) : ?>            
            <h2 class="site-description"><?php echo bloginfo('description'); ?></h2>
        <?php endif; ?>

    </div>

    <div id="header-content" class="clearfix">
        <?php get_template_part('inc/header-content'); ?>
    </div>

</header>

The title is probably placed within the header.php file.

So openup and find something like:

<h1><a href="<?php bloginfo('url');?>"><?php bloginfo('name');?></a></h1>

This is what displays Abraham & Co on your website.

Now first of you need your image uploaded to you images folder in the theme folder.
Add the following code BEFORE the code above:

<img src="<?php bloginfo('template_directory');?>/images/your-logo.png">

make sure you change your-logo.png to whatever image file you have uploaded to you images folder.

Optionally you can wrap the image in a div with a class to add some css in your style.css file

-- UPDATE --
I have downloaded the theme that you use but indeed this isn't in the header.php file. There is a file called template-tags.php. In this file on rule 17 you find <h1 class="site-title"><?php bloginfo('name'); ?></h1>

This is what displays Abraham & Co on your website. But you should first check to add a logo via the admin screen options of you theme because I believe you can just upload an image.

If you can't do the following: Upload your image to your images folder in your theme folder.
Replace:

<a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    <h1 class="site-title"><?php bloginfo('name'); ?></h1>
</a>

and replace it with:

<img src="<?php bloginfo('template_directory');?>/images/your-logo.png">
<a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    <h1 class="site-title"><?php bloginfo('name'); ?></h1>
</a>

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.