• Resolved TechTalk

    (@techtalk)


    I’ve managed to alter my site in several ways but am now stuck on adding an image to the header. My base theme is copyblogger and here is a list of changes that I’ve done:

    Moved the navbar into the header and adjusted font / padding / margins.
    Changed the header text to black for posts.
    Removed the black and red footer blocks.

    Here is what my code looks like right now:
    style.css

    #logo { width: 750px; height; 100px; margin: 0 auto; padding: 0em 0em 1em 0em; }
    
    	#logo a { font: normal 5.0em "American Typewriter", "Trebuchet MS", Verdana, sans-serif; color: #fff; }

    header.php
    [Code moderated as per the Forum Rules. Please use the pastebin]

    My image is located inside the theme folder at “/images/logo.png”

    I’ve been trying to find the solution through trial and error but I have yet to succeed.

    Any help would be greatly appreciated.

Viewing 15 replies - 1 through 15 (of 15 total)
  • try yo use an absolute path to the image;

    instead of:

    <div id="logo"><img src="/images/logo.png"></div>

    try to use:

    <div id="logo"><img src="<?pgp bloginfo('stylesheet_directory'); ?>/images/logo.png"></div>

    https://codex.www.ads-software.com/Function_Reference/bloginfo

    Thread Starter TechTalk

    (@techtalk)

    I get a syntax error when using your line of code.

    I’m on my way out the door so I’ll play with it when I get back tonight.

    it is supposed to say php instead of pgp:

    <div id="logo"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.png"></div>

    Thread Starter TechTalk

    (@techtalk)

    That did the trick, thanks.

    I’ve got a few more questions I’m hoping you guys can help me out with:

      I’d like to have a footer on the bottom where I can add maybe a small slideshow of popular posts and some streaming posts from different categories. Is there an easy way to go about this?

      Before my title there is a – hyphen. There isn’t a hyphen in my wordpress control panel so where did it come from and how do I remove it?

    Thread Starter TechTalk

    (@techtalk)

    Just wanted to give this thread a bump.

    I’m looking into the footer myself but more importantly I need to know where the hyphen “-” is coming from in my title so I can remove it.

    Instead of “Title”, I’m getting “—Title”. There are no hyphens in the wordpress control panel.

    Where is this coming from in the code?

    can you post a link to your site, and the name of your theme?

    Thread Starter TechTalk

    (@techtalk)

    https://www.naturallynerds.com

    The theme name was posted above and is copyblogger.

    look into header.php and for the code between <title> ......... </title>

    and then post it here.

    if you are using a seo plugin, check the plugin settings and options.

    Thread Starter TechTalk

    (@techtalk)

    Here’s the code:
    <title><?php if (is_home()) { bloginfo('description'); } else { wp_title('',true); } ?> — <?php bloginfo('name'); ?></title>

    try:

    <title><?php if (is_home()) { bloginfo('description'); ?> &ndash; <?php } else { wp_title(' - ',true, 'right'); }; bloginfo('name'); ?></title>

    https://codex.www.ads-software.com/Function_Reference/wp_title

    Thread Starter TechTalk

    (@techtalk)

    When I switched out the code nothing changed. Any other suggestions?

    this is because you have not entered any content into the blog description (tag line) in the settings.

    try with a conditional tag:

    <title><?php if ( is_home() && get_bloginfo('description') ) { bloginfo('description'); ?> – <?php } else { wp_title(' - ',true, 'right'); }; bloginfo('name'); ?></title>
    Thread Starter TechTalk

    (@techtalk)

    That did it, thanks a lot for the help!

    Thread Starter TechTalk

    (@techtalk)

    New problem:

    It appears that my navbar has now changed. The Home button is lower then the others. I can’t see anything in the code that may be causing this. Here’s the code:

    Style.css
    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

    nav_menu.php
    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter TechTalk

    (@techtalk)

    I was able to fix the problem.

    Thanks for the help guys!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Help needed adding image in header’ is closed to new replies.