R. Carvalho on "[Theme: Nisarg] Putting a logo in the header"

ساخت وبلاگ

Hello adieu.
I wanted to do the same thing, but couldn't find the answer anywhere.
Then I decided to mess with the php files and finally got it done right.

And while there might be an easier way to do that, as a non-programmer, this is how I've done it.

First, I'd recommend a small logo image, not bigger than 90px height so it won't mess with your mobile and tablet layouts.

You don't need to deal with css at all.

The steps:

1 - Upload your logo through the media panel in WP. Copy the logo url. It will look like this:

http://yourdomain.com/yourWPdirectory/wp-content/uploads/2016/06/logo.png

Reserve. You're gonna need it.

2 - Then open this file:

/wp-content/themes/nisarg/header.php

3 - Find and remove this bunch of code:

<div class="site-header"> <div class="site-branding"> <a class="home-link" 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> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> </a> </div><!--.site-branding-->

4 - Put this code instead, int the exact same place:

<div class="site-header"> <div class="site-branding"> <a class="home-link" 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> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> -->
<!--your logo line --><h1 class="site-title"><img src="your logo url" alt="Your logo name"></img></h1><!-- end of your logo line --> </a> </div><!--.site-branding-->

5- Edit the code with your logo url and title.

That's it.

Notice The original h1 and h2 are <!--commented--> so they have no effect. In case you want to revert the change, just remove the new line and the comment marks.

Also, make sure you leave the option to show title and description marked in the WP panel.

Hope this is what you were looking for!

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 237 تاريخ : پنجشنبه 10 تير 1395 ساعت: 22:32