adsense

How to Place a Logo in a WordPress Header





1. Open the 'header.php' template file from the folder containing all the files for your current WordPress theme. You can find this folder by navigating to the main folder of your website and double-clicking on 'wp-contents' and then 'themes.'
2. Place an
tag in the code where you want the logo to display. You can put it in anywhere after the opening
tag, but a
tag labeled something like 'header' or 'logo' is best. Names of
tags in themes vary, but you should be able to tell their purpose by what they are called. Here is an example:



In the above code, an
tag was added to a
called 'heading,' and below it is the code for a WordPress menu.

3. Add the bloginfo() function to the path to your logo within the
tag. You can use bloginfo() to output the path to your theme files. The code looks like this:
/logo.png' />The browser will then see the path to the theme folder. If your logo is located within a folder called 'images' under your theme folder, use code like this:
/images/logo.png' />
4. Wrap an anchor tag around your logo to make it a link. You should link the logo to your home page because users expect that. Here is the code:
'>
/logo.png'>
Notice that the anchor tag above also uses the bloginfo() function, but now it contains 'wpurl' instead of 'template_directory.' These parameters tell the function what type of info you want to display. In this case, 'wpurl' displays the URL -- the Web address -- of your WordPress-based website.
5. Use bloginfo() to add some more information to your logo, such as a title for the link or alternative text for screen readers. Adding this information is good for Search Engine Optimization, or SEO, and will improve your Google rankings. Here is code with 'title' and 'alt' attributes added:
' title='
'>
/logo.png' alt='Welcome to
'>

Comments

0 Responses to "How to Place a Logo in a WordPress Header"

Post a Comment

Popular Posts

About