WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] title to logo jpeg (18 posts)

  1. PKPrague
    Member
    Posted 1 year ago #

    I searched and read about how to change the title to a picture (jpeg) however, it says to open header.php in my theme (twenty ten) and If the site in question is the one linked to in your profile open header.php search for:

    <div class="logo">"><?php bloginfo('name'); ?></div>

    Replace with:

    <div class="logo">"><img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></div>

    BUT, I do not see this in header.php (used find function)? Help please?

  2. zartgesotten
    Member
    Posted 1 year ago #

    In TwentyTen it's more complex. Starting in line 60 there's this:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>

    Replace that and you should be fine.

  3. PKPrague
    Member
    Posted 1 year ago #

    thanks for your quick response, beckons the question, replace that with what? The above?
    <div class="logo">"><img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></div>

    ? and put the jpeg in the image folder? Thanks so much for one more reply.

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  4. zartgesotten
    Member
    Posted 1 year ago #

    Exactly...

    <div class="logo">"><img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></div>

    instead of

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
  5. PKPrague
    Member
    Posted 1 year ago #

    apparently I am still doing something wrong: http://kielhurn.com/wordpress/

    Why is it making a black line above and below the logo?
    Not real good at HTML, how to get it to link to the home page (HREF, but where and what code?)
    Obviously, something is outside the closed tag, might someone with some experience at this assist? Appreciate it....

  6. zartgesotten
    Member
    Posted 1 year ago #

    Yes, sorry...
    I just copied your code without checking. There's an error in the code you first posted.

    This should be right:

    <div class="logo">
    <img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></div>
  7. zartgesotten
    Member
    Posted 1 year ago #

    Also your Image has a black border because of your css. In style.css on line 364 there's this:

    #branding img {
    border-top: 4px solid black;
    border-bottom: 1px solid black;
    display: block;
    float: left;
    }

    Remove the borders and you should be fine.
    Then there's the span with text in it. Maybe you should put this in your header (forget what I said in my last post ;-)):

    <div class="logo">
    <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    <img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></a>
    </div>
  8. PKPrague
    Member
    Posted 1 year ago #

    "Maybe you should put this in your header" meaning update line 60 with that? Forget about the `<div class="logo">
    <img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></div>` ?

    Sorry for being such a NB, you have been very helpful. What about linking the logo back to index? Appreciate you taking the time ...

  9. zartgesotten
    Member
    Posted 1 year ago #

    That's exactly what my second bit of code does. It links the image back to your homepage.

    Yes. Remove the whole

    <div class="logo">
    <img src="<?php bloginfo('template_directory'); ?>/images/logo.gif" /></div>

    .... and replace it with the new code I gave you in the last post.

  10. PKPrague
    Member
    Posted 1 year ago #

    whew- borders are gone and its linking, last problem: why is the wording showing up on the side? I use the find function in Editpad for my last name and it only finds this:

    <a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    <img src="<?php bloginfo('template_directory'); ?>/images/kielhurn175x69.jpg" /></a>

    Note the name is typed next to the logo....sorry for the inconvenience, if you would, one last time? You wear it well guy :]

  11. zartgesotten
    Member
    Posted 1 year ago #

    I still see an error in the code you posted up there...

    <a>" title
    is wrong.

    May I suggest you create a paste at pastebin.com and put your whole header.php in there the way it is now. I will look at it and we'll figure it out.

    I see a span there that has that link in it. But as I don't see your php code I can't see where it's coming from.

    You're welcome!
    wearitwell --> girl ;-)

  12. PKPrague
    Member
    Posted 1 year ago #

    girl;) I should have thought of that. What guy uses the name weaaritwell :}

    Never used pastebin, but registered, logged in and it is under my last name? Can you access it? I'm thinking it is public:

    Your stats:
    Total number of active pastes: 1
    Number of public pastes: 1

    Your a great help (and a girl) !

  13. zartgesotten
    Member
    Posted 1 year ago #

    You didn't have to register. But now that you have, log in, click on your paste (should be on the right side where it says: your pastes) and copy the url of that page. It should look like this:

    http://pastebin.com/D7gbeWmh

    Put that link in here so I can look at the paste.
    We'll get there... ;-)

  14. PKPrague
    Member
    Posted 1 year ago #

    what a helpful gal :]

    http://pastebin.com/d10XZwqU

  15. zartgesotten
    Member
    Posted 1 year ago #

    We made it !
    There's your new header:

    Paste

    Copy the whole thing and replace your old file (after making a backup of course).

    There was an additional span with the culprit in it:

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

    Good Luck!

  16. PKPrague
    Member
    Posted 1 year ago #

    Dankeschön ! You've been most helpful and I am very appreciative ...Thank you

  17. zartgesotten
    Member
    Posted 1 year ago #

    You're welcome!
    Have fun with your site!
    You may want to close this thread! ;-)

  18. PKPrague
    Member
    Posted 1 year ago #

    you're the best :] Thanks again...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.