SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inserting Logo into Wordpress Page above H1

    Hi, I wanted to insert a logo above my H1 on all pages except the frontpage. I'm a CSS noobie and been trying to figure this out any help would be greatly appreciated! Here's the site: http://goldenarcherinvestments.com/about-us/

    It's this div:


    <div id="col-left">
    <h1> About Us</h1> <ul>

    <li class="page_item page-item-102"><a href="http://goldenarcherinvestments.com/about-us/investment-philosophy/" title="Investment Philosophy">Investment Philosophy</a></li>
    <li class="page_item page-item-105"><a href="http://goldenarcherinvestments.com/about-us/meet-the-team/" title="Meet the Team">Meet the Team</a></li>
    </ul>
    </div>

    Where would I have to put the code to insert a small .png logo?

    Thanks

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Above the <h1> tag

    PHP Code:
    <?php if (!is_home()): ?>
    <img src="/logo.png" />
    <?php endif; ?>
    This doesn't involve any CSS unless I'm missing something

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,540
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Sorry but I don't use wordpress so don't know how you would internally change the code but in terms of css and html it's pretty easy to do but depends on what it's supposed to look like.

    I see you have inserted an archer.png image above the h1 - is that the logo you are talking about?

    I don't know how you wanted it to look but I guess you meant to set the left column to clear it and not snag.
    e.g.

    Code:
    #col-left {clear:left}
    Edit:


    Dan has answered with the wordpress side of things

  4. #4
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    Hi,

    Sorry but I don't use wordpress so don't know how you would internally change the code but in terms of css and html it's pretty easy to do but depends on what it's supposed to look like.

    I see you have inserted an archer.png image above the h1 - is that the logo you are talking about?

    I don't know how you wanted it to look but I guess you meant to set the left column to clear it and not snag.
    e.g.

    Code:
    #col-left {clear:left}
    Edit:


    Dan has answered with the wordpress side of things
    Yes it's the archer logo I inserted. I created another div tag, col-left2, and inserted <div id="col-left2"></div> into the sidebar.php file.

    I didn't know how else to do it. I will try the pure php way thanks!

  5. #5
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    Above the <h1> tag

    PHP Code:
    <?php if (!is_home()): ?>
    <img src="/logo.png" />
    <?php endif; ?>
    This doesn't involve any CSS unless I'm missing something
    Adding that code above the h1 to the sidebar.php file gave me an error.

    This is exactly what is in the .php file:

    Code:
    		<!-- content -->
    		<div class="content clearfix">
    			
    			<!-- col-left -->
    
    	        <div id="col-left">
    			
    				<?php if(!is_home() and !is_search() and !is_single()) {
    				/* For non-blog pages */ ?>
    					<?php
    					echo "<h1>";wp_title('');echo "</h1>";
    						if($post->post_parent)
    						$children = wp_list_pages("sort_column=menu_order&depth=1&title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("sort_column=menu_order&depth=1&title_li=&child_of=".$post->ID."&echo=0");
    						if ($children) { ?>
    						<ul>
    						<?php echo $children; ?>
    						</ul>
    			<?php } ?>
    			<?php } ?>
    			
    			<?php if(is_home() or is_search() or is_single()) {
    			/* For blog page */	?>
    					<?php if(function_exists('dynamic_sidebar') && dynamic_sidebar('Blog-sidebar')) : ?>
    					<?php endif; ?>
    					<?php 
    						if(get_option('da_search')=="true")
    							get_search_form();
    			 } ?>
    			
    			
    	        </div>

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Put it right after <div id="col-left"> before the next <?php tag

  7. #7
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    Put it right after <div id="col-left"> before the next <?php tag
    Thanks, that worked perfectly!

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,321
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Just as an aside, it's not considered good practice to have more than one H1 per page. Have you considered something like an H2, or even just a <p>?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •