To download my Thesis Wordpress custom stylesheet and custom_functions.php file (as well as icons), click on the download folder.
A few weeks ago I mentioned my love for the thesis theme as I was implementing it on my blog. At the time I was a bit confused as to how to use the custom hooks in Thesis. I have some knowledge of HTML and CSS, and do understand some PHP, but eh I’m no programmer. Still, I’ve experimented quite a bit with the hooks and can now say that they are cleverly constructed. Anyone willing to get their hands (somewhat) dirty can achieve great levels of customization within two easily configurable elements: the custom.css style sheet and the custom_functions.php file. I’ll guide you through the modifications I’ve applied on this blog (with code and source files). This should get you going on your own Thesis customization.
Customizing the Thesis Header
The first thing I wanted to modify in the Thesis theme was the placement of the nav_area (menu and pages) as well as the logo and tagline. Within Wordpress, start by enabling the custom stylesheet:
Design > Thesis Options > Customize your Thesis Design
Also, make sure Full-width Framework is enabled:
Design > Design Options > HTML Framework
Now we can start coding.
Open up custom_functions.php within an HTML editor (I use Dreamweaver), which is located within your Thesis > Custom folder. This file will be used to code your own custom functions that will be inserted within the Thesis framework. In most Wordpress themes, you would need to add your custom code inside each .php page. For example, to modify the header, you would open up header.php and add your code to the existing code. Not only is it time-consuming to manage multiple code files but the risk of messing up core code can make it intimidating for people not used to programming. Thesis is built around hooks. Before going any further, look at the image below (it comes from the Thesis Help Forums):
Hooks are basically placements around your Thesis theme. You can attach code to any of these hooks. For instance, if I wanted to add some code before a blog post, I would use this hook:
thesis_hook_before_post
Hooks enable the customization of code from one .php page (custom_functions.php). So let’s start digging in.
In order to change the nav_area placement, we will have to create a custom function. Start by adding this piece of code at the bottom of the custom_functions.php page:
/* To clear up the header */
remove_action(’thesis_hook_before_header’, ‘thesis_nav_menu’);
remove_action(’thesis_hook_header’, ‘thesis_default_header’);
/* Adds the navigation menu above the Title */
function full_width_header() { ?>
<div id=”nav_area” class=”full_width”>
<div class=”page”>
<?php thesis_nav_menu(); ?>
</div>
</div>
<div id=”title_area” class=”full_width”>
<div class=”page”>
<div id=”header”>
<?php thesis_default_header(); ?>
</div>
</div>
</div>
<?php
}
add_action(’thesis_hook_before_html’, ‘full_width_header’);
The first two lines of code clear up the header for the custom navigation. Then comes a function called full_width_header() which adds the navigation menu above the Title. Finally, the third line of code attaches that function to the thesis_hook_before_html hook. That’s it for this part of the .php code!
I have taken some snapshots of Firebug in action in order to help you understand which piece of code does what. By the way, if you haven’t installed Firebug for Firefox yet, I highly encourage you to do so. It is a very helpful add-on to have.
Here you can see the <div id=”nav_area” class=”full_width”> highlighted in Firebug, with pages hierarchy underneath. On the right hand side, CSS styles for this particular Div are listed. Notice the way the full_width_header() function uses this same hierarchy to call the thesis_nav_menu() and thesis_default_header().
Now let’s style the header. As you can see, I’ve attached an image on the right-hand side of the logo and tagline. I have also eliminated the line that was going across the nav_area, underneath the tabs. These elements have all been styled using the custom.css file. Again, the Thesis theme provides one global stylesheet that can be configured to your liking. Since it overrides only the duplicated styles of the style.css sheet (the one you SHOULD NOT modify, NOT located in the Custom folder), you won’t be messing with the core styles in an irreversible way.
You can download my custom.css stylesheet for the Wordpress Thesis theme here. It is also part of the download file I’ve prepared (you can find it at the beginning of this post).
Add this bit of code at the bottom of your custom stylesheet:
/*To make nav styles disappear and style the new nav*/
.custom #header_area{ display: none; }
.custom #nav_area ul { border-bottom: none; border-left: none; }
.custom #nav_area ul li { border-width: 0; margin-bottom: 0; padding-bottom: 0; background: none; }
.custom #header { border-bottom: 5px; }
.custom #header_area{ display: none; }
.custom #nav_area { background: none; padding: 0.5em 0; border-bottom: none; }
.custom #nav_area ul { border-bottom: none; border-left: none; }
.custom #nav_area ul li { border-width: 0; margin-bottom: 0; padding-bottom: 0; background: none; }
.custom #title_area { background: none; padding: 1em 0; border-bottom: none; }
.custom #header { border-bottom: none; }
This will give some padding to your header and get rid of some of the borders. To attach an image inside the header, next to the logo and tagline, add this bit of code:
/*Attaching an image/logo in the header*/
.custom #title_area { background: none; padding: 1em 0 0.5em; border-bottom: none; }
.custom #header { border-bottom: none; height: 140px; padding-top: 0; padding-bottom: 0; background: url(images/logo.png) top right no-repeat; }
Put your image in the Custom > Images folder, and change logo.png for the name of your logo under background: url(images/logo.png). The height attribute will determine how big your header will be. Avoid using too big of a header as you want to leave as much space real estate for content as possible. In this case, I’ve attached a small image in the top right corner of the header. By changing these attributes, you’ll modify the positioning of your image. This Firebug snapshots shows the code hierarchy of the header section:
If you want the logo and tagline to disappear, you can add this code:
.custom #header #logo { display: none; }
.custom #header #tagline { display: none; }
Personally I like the tabs look and wanted to keep them. I’ve added this code to restyle them without the long border that was going across the page:
.custom #nav_area ul { border-bottom: none; border-left: 1px; }
.custom #nav_area ul li { border-width: 1px; margin-bottom: 1px; padding-bottom: 0; background: none; }
.custom #nav_area ul li.rss { border-width: 0px; margin-bottom: 0px; padding-bottom: 0; background: none; }
.custom #nav_area ul#tabs { border-left: 1px; }
.custom #header { border-bottom: none; }
.custom #header { border-top: none; }
/*—:[ nav menu styles ]:—*/
.custom #nav_area ul#tabs { list-style: none; border: 1px solid #999999; border-width: 0 0 0px 1px; }
.custom #nav_area ul#tabs li { margin-bottom: -0.1em; background: #FFED60; border: 1px solid #999999; border-left: 0; float: left; }
.custom #nav_area ul#tabs li.current_page_item, ul#tabs li.current-cat { padding-bottom: 0.1em; background: #fff; border-bottom: 0; }
.custom #nav_area ul#tabs li a { display: block; line-height: 1em; color: #111; text-transform: uppercase; letter-spacing: 2px; }
.custom #nav_area ul#tabs li a:hover { color: #111; text-decoration: underline; }
.custom #nav_area ul#tabs li.current_page_item a, ul#tabs li.current-cat a { cursor: default; }
.custom #nav_area ul#tabs li.current_page_item a:hover, ul#tabs li.current-cat a:hover { text-decoration: none; }
.custom #nav_area ul#tabs li.rss { padding-right: 0; background: none; border: none; float: right; }
.custom #nav_area ul#tabs li.rss a { padding-right: 16px; background: url(’../images/icon-rss.gif’) 100% 50% no-repeat; float: right;}
This is it for the header tutorial. I’ve added more resources at the end of this post if you’re interested to read more or push your customization a few steps further.
Adding Social Bookmarking Links at the End of your Posts
Social bookmarks help in getting authority from search engines. It’s actually quite simple to add your own bookmarking icons. We will have to start by adding some more functions to the custom_functions.php file.
At the bottom of the page, we will add a function to link Stumble Upon and del.icio.us. It goes like this:
/* Adds Stumble Upon and del.icio.us bookmark links after each post */
function add_social_media () {
?>
<ul>
<li id=”stumbleupon”><a href=”http://www.stumbleupon.com/submit?url=<?php the_permalink() ?>”>Stumble Upon </a></li>
<li id=”delicious”><a href=”http://del.icio.us/post?url=<?php the_permalink() ?>&title=<?php the_title(); ?>”>Bookmark this on del.icio.us</a></li>
</ul>
<?php
}
add_action(’thesis_hook_after_post’, ‘add_social_media’);
The function consists of a list of 2 elements: a “<li id=”stumbleupon”>” and “<li id=”delicious”>” tags. Notice I’ve added some id to both tags. I did this because I want to style both list elements without it affecting all the “<li>” tags on my blog. I also want to attach bookmarking icons next to each link. This is all the code you need in the .php page. If you wanted to add Digg or any other service to your posts, all you would need to do is add another list element with proper link and id. Now to style both tags and attach icons, you’ll need to add this code at the bottom of your custom.css stylesheet:
/*Adds Social Media icons next to Stumble Upon link and del.icio.us underneath each post*/
.format_text ul li#stumbleupon { list-style: none; padding-right: 0; background: none; border: none;}
.format_text ul li#stumbleupon a { padding-right: 25px; padding-left: 25px; padding-bottom: 5px; background: url(’images/stumbleupon.png’) 100% 50% no-repeat; float: right; }
.format_text ul li#delicious { list-style: none; padding-right: 0; background: none; border: none; }
.format_text ul li#delicious a { padding-right: 25px; padding-bottom: 5px; background: url(’images/delicious.png’) 100% 50% no-repeat; float: right; }
This will get rid of the bullet points, will align links onto the right hand side, will add some padding to it all, and finally it will attach the bookmarking icons next to your links. I have added the Stumble Upon and del.icio.us icons onto the download file at the beginning of this post. Make sure you save them onto your Custom > Images folder. Again, here is a snapshot of Firebug showing the code placement within your Thesis theme:
Must-have Plugins for your Thesis Wordpress Theme
Google XML Sitemaps Plugin
This great (and free) plugin generates XML sitemaps of your blog and submits them to Google, Yahoo! and Live Search. The Thesis theme is constructed in such a way that pretty much all your content should be indexed easily, and some of you might wonder what’s the point of generating sitemaps. When submitting your sitemap to Google when a new post is up or content has been changed, the time it takes for bots to visit your site will be greatly reduced, which means faster indexation.
WP-DB-Backup Plugin
This plugin creates backups of your database. There isn’t really a point in discussing the virtue of backing up, we all know what losing valuable materials is like. It’s also good to run a backup before updating Wordpress (like upgrading to version 2.7! By the way, the lastest version of the Thesis theme, 1.3.3., is also out. It supports the latest version of Wordpress).
Askimet Plugin
Askimet is preinstalled in Wordpress, but for it to be functional you need to first activate it and then get your API key from Wordpress.com (unless you already have one). It is a spam filter for comments that is quite effective.
Mint for Analytics
Mint analyzes server data and produces tons of analytics data on user behaviors, visits and plenty more. A 30$ very well invested. Easy to install, it can be done from within Thesis.
Voil







{ 72 comments… read them below or add one }
Hi, thank you so much for your helpful post on altering header. I’m still not following you on this. On my, http://realestateappraisertips.info/ , what code do I add to my custom.css file to make just my Top Nav Buttons yellow or FFFF00 color? Thank you so much for your time!!! Bill Cobb fastvalue@cox.net
Hi Bill, thanks you for stopping by! To change the Top Nav buttons, add these lines to your custom.css sheet:
.custom #nav_area ul#tabs { list-style: none; border: 1px solid #999999; border-width: 0 0 1px 1px; }
.custom #nav_area ul#tabs li { margin-bottom: -0.1em; background: #FFED60; border: 1px solid #999999; border-left: 0; float: left; }
The first bit of code (.custom #nav_area ul#tabs ) defines line styles, as the second one defines each different pages (ul#tabs li – a list tag). To change the border color, modify this: #999999. To change the background color, modify this: background: #FFED60.
Hope that helps! Let me know if you need further explanations.
Hi, Thank you so much for your time in helping me. I did add the code you suggested to my “custom.css” file, saved and it’s not changing anything up top with the buttons, not making them the FFED60 color? Here’s my full custom.css code below. Again, thank you for your time!!! Bill
/*
File: custom.css
Description: Custom styles for the Thesis Theme that you define
Use:
If you have enabled the custom stylesheet in the Thesis options panel, the tag
will be appended with the “custom” class, like so: . You can use
the “custom” class to overwrite *any* CSS declarations contained in the style.css file.
For example, if you wish to change the default link color to green, you would add the
following declarations to this file:
.custom a, .custom a:visited { color: #090; } <— This makes links green
.custom a:hover { color: #00f; } <— This makes links blue when you mouse over them
Why this works:
By using the “custom” class, you are creating more specific CSS declarations for HTML
elements. CSS styling is applied through rules of specificity, and because declarations
prepended with .custom are more specific, they get applied when the page is rendered!
*/
body.custom {
background: #000066;
}
.custom #container {
margin-top: 2em;
margin-bottom: 2em;
padding: 0.3em;
background: #000000;
border: 1.1em solid #000000;
}
.custom #page {
background: #fff;
}
.custom #nav_area ul#tabs { list-style: none; border: 1px solid #999999; border-width: 1 1 1px 1px;
}
.custom #nav_area ul#tabs li { margin-bottom: -0.1em; background: #FFED60; border: 1px solid #999999; border-left: 0; float: left;
}
Hi Bill,
The reason why it is not working is you do not have any div called #nav_area on your page. The div on your page is called #page. Try this instead:
.custom #page ul#tabs { list-style: none; border: 1px solid #999999; border-width: 0 0 1px 1px;
}
.custom #page ul#tabs li { margin-bottom: -0.1em; background: #FFED60; border: 1px solid #999999; border-left: 0; float: left;
}
That should sort it out. Again, let me know if know if you need further explanations.
THANK YOU!!!!! THANK YOU!!!! THANK YOU!!!! THAT WAS THE RIGHT CODE AND IT WORKS GREAT!!!! THANK YOU!!!! SO MUCH!!!! BILL
Does anybody know how to align the entire body to the left of the browser in thesis? Everything right now for me has about 100 pixels between the left of the browser and the start of the header and browser and the same for the main content. The navigation is actually aligned left with a background image however the “nav_area” and the “content_area” is about 100 pixels off to the right.
Thanks in advance,
Joe
Hi Joe,
Is your Thesis blog online so I could go have a look? Also, have you enabled the full-width framework within the Thesis options in Wordpress?
Thanks Francis for taking a look:
Yes, full-width framework is activated.
Here is the UrL: http://www.marty-collins.com/
I have to bring the header and rest of the body flush to the left. One other design challenge that I am having is making a 100 pixel or so column on the left hand side to give some space from the edge of the browser to the start of the blog content.
Thanks in advance!
Joe
Hi Francis,
I thought I responded to the post earlier but I think it did not post, here it is again:
Yes I do have the full-width framework activated and we are working in Thesis.
Website is: http://www.marty-collins.com/
There is another design issue as well – I need to make a column on the left side with a width of about 100px. I did insert a div ( ) using ‘thesis_hook_before_content’ in the ‘custom_function.php’ file but I have had mixed results: it appears but it is pushing the beginning of first comment and all content below it under the column. Not sure if you have any ideas for this either.
Thanks Francis!
Joe
Hi Joe,
Ok, I looked at your website, and here’s what I think you need to do.
In your .custom #title_area function, make sure your width is 100%. It is also in that function that you should be attaching your background image – not in .custom #header. This means:
.custom #title_area { background: url(MartyCollins_masthead.jpg) no-repeat scroll left top; width: 100%; (and whatever other arguments you already have in there) }
Make sure you take off background url from .custom #header.
This will make your header flush with the page.
To do same with body, you’ll need to add this function to your CSS:
.custom .full_width .page {margin:0px; padding: 0px; width: 100%; }
Everything on your page should then be flush to the left hand side.
Get Firebug for Firefox, you can implement those CSS changes directly in the browser and see first hand how it changes the display of your page. Very useful!
Regarding adding a 100px border on the left hand side – do you want your design to “float” 100px to the right where the empty space will be white (or a different color) or do you want to keep same design but content will start 100px to the right?
Has anyone called you St. Francis before (don’t mean to get biblical but…)?
You are a SAINT. I will try to implement your suggestions and they seem feasible. I am very excited.
In terms of the border on the left hand side – I need to make a border/column that stretches the height of the content (to match any blog content). I will need that border/column/design element (in the color brown in the masthead – immaterial I know) to just push over the white column/ blog content – so I believe it will be the same design with content starting 100 px to the right. Whatever method I use is fine just as long is there is the brown column/ the beginning of the content column in white with of course normal space for text to breath on either side.
SO: Brown Border 100px/beginning of wordpress content Main Content/Sidebar 1/ Sidebar 2/
The brown column will give the eye a little space before the Blog content begins.
Thanks for all your help!
Joe
Alright,
Right now you have 4 different Divs that make up your page – title_area, nav_area, content_area and footer_area. The easiest would be to include all those into one div then move this div to whatever position you need it to be, i.e. add padding/margins, or center it on the page.
For that you’ll have to create a new div in custom_functions.php that would include all aforementioned divs with hierarchy. For instance:
function div_allincluded { ?>
< ?php thesis_nav_menu(); ?>
//you would do the same with the 2 remaining existing divs
}
Then you call your function:
add_action(’thesis_hook_before_container’, ‘div_allincluded’);
That’s gonna create one big container with all your divs in it. You can now adjust its positioning in your custom.css file:
.custom #all { (where you would change padding, floating, etc.) }
Let me know if this works or not!
These comments are HTML-enabled, so lots of the code didn’t get through. I’ll send you an email with code in
Thanks Francis! Your suggestions are great. My site is full width now and flush to the left. Now I just need to add a column.
These are the two divs you are referring to are correct?:
The thesis_footer_scripts I am pretty sure about but the main blog content was a little hard to track down in forums and documentation. But this seemed like the line of code in the launch.php file that is referring to the main content and side bars (thesis_post_navigation).
Also, for some reason this last line of PHP is producing an error:
<?php }
add_action(’thesis_hook_before_container’, ‘div_allincluded’);
I sent you the file just in case you have time to take a look.
Thanks again!
Joe
Thanks for all your provided info! It helped me a lot. But … I really can’t find where to change the frameborders! The image you have here have a white border and an outerborder which is green.
I know it’s a stupid question; i’ve solved a lot of probs but i can’t find it. Maybe i’m editing the theme too long now haha
Thanks!!
Thanks Sydney, I’m glad I can help. You’re talking about the menu, right? Here’s the bit of code to make it green and dotted:
.custom #nav_area ul#tabs { border-color:#D9FF00; border-style:dotted; border-width:0 0 1px 1px; list-style-image:none; list-style-position:outside; list-style-type:none; }
.custom #nav_area ul#tabs li { background:#EEFFCF none repeat scroll 0 0; border-color:#D9FF00; border-style:dotted; border-width:1px; float:left; margin-bottom:-0.1em; }
Just change #D9FF00 to whatever color suits your needs. If you want a regular border instead of a dotted one, just get rid of the border-style argument.
Hope that helps!
Well presented post and thank you for the link!
Thanks to you Kristarella! I wouldn’t have made it without the great help of your tutorials
I have been trying to get the custom background to work but what keeps happening is the whole page turns the color of the body.custom and does not leave the middle white. I have followed you and Kristarellas instructions and tried hundreds of different ways to make it work but the best I could come up with is to utilize a color in body.custom and then call a graphic I made as the middle. There has to be a better way. Any thoughts
Hey Todd,
If I hear you right you want to have a specific background color while keeping your header white.
Try these lines of code:
/*Change #DDDDDD to whatever background color you want.*/
.custom body { background: #DDDDDD; }
/*Change #title_area and #nav_area to whatever ids your header has. If you don’t know what your DIVs ids are, you can look them up with firebug.*/
.custom #title_area, .custom #nav_area { background: #FFFFFF; }
Let me know if this works for you!
Good luck,
Francis
hi i am wonder if there is any way to add html or java script under the header image? i am trying to place the 468?15 horizontal google ad links under my site logo at the top.
Thank you.
Hi Francis
Fantastic piece of work.
I would like to remove the tagline however wrap the logo and alt tag in , how code I add this?
thanks
Azzam
Hey Alex and Azzam,
Thanks for taking the time to write.
Alex: To attach you Google Ad links, you’ll need to write a piece of code within the custom_function.php page. Write a function of your own, like:
my_function {
//this is where you would insert your Google Ad code
}
Then you call this function with the proper hook:
add_action(’thesis_hook_after_title’, ‘my_function’);
Azzam:
To hide the tagline, add this to custom.css:
.custom #header #tagline { display: block; }
I’m not sure I understand what you mean by wrapping the logo and alt tag in – care to give me more explanations?
Thanks to both of you, good luck!
Hi Francis,
1) How do I change the default image that appears on the top right in thesis
2) Where should I add adsense code?
theme? Thank you.
Hey,
1- To change the images, just add your own images to the image folder inside the custom folder. You can enable/disable the viewer within the wordpress interface, under Thesis preferences.
2- It really depends where you want your adsense to appear. If you want it in the sidebar, I would suggest pasting the code within a widget text box. That also can be done within wordpress – no need to add/modify the thesis code.
Hope that helps, have a great day,
Francis
Thanks for the great tips and help Francis. I too was looking for a solution just like Alex and I’m glad to have found it right here!
Hey Penny,
Thank you so much for your comment. Glad this was helpful to you!
Thanks so much, Francis. Appreciate your help.
S
hi,
great job.thanks for sharing this,it’s useful for my site.
thanks a lot for your help. just one more thing, in between my logo and bottom border there is a wide chunk of white space i cannot get rid off. do you know how i can get rid of this? i see you logo is very proportional.
nvm thanks for everything but i got it fixed
Cool info! I added an image to my header, but I was wondering if you had any idea how to make that image clickable? I want it to link back to my home page. Thanks a lot!
Hey Daniel,
Thanks for your comment!
The easiest way to do this is as follow:
In custom_functions.php, you need to create a function to attach your image:
my_header{
}
Replace “header” for your proper DIV id, “a href” for the URL of your site and “your URL image” for your image URL (static or relative, that is up to you).
Then,
add_action(’thesis_hook_before_title’, ‘my_header’);
That should do it! Let me know if you need more help!
Thanks for responding so fast! I’m really a beginner when it comes to CSS and .PHP, so for some reason I can’t get it to work – heres what I have: I’m probably just using quotes wrong or something…. or I also wasn’t sure if div id=”header” was right or if there was another name I should have used.
my_header {
}
add_action(’thesis_hook_before_title’, ‘my_header’);
Heres what I had originally put in the Custom.css file to add the header image (I just basically copied this from above):
/*To make nav styles disappear and style the new nav*/
.custom #header_area{ display: none; }
.custom #nav_area ul { border-bottom: none; border-left: none; }
.custom #nav_area ul li { border-width: 0; margin-bottom: 0; padding-bottom: 0; background: none; }
.custom #header { border-bottom: 5px; }
.custom #header_area{ display: none; }
.custom #nav_area { background: none; padding: 0.5em 0; border-bottom: none; }
.custom #nav_area ul { border-bottom: none; border-left: none; }
.custom #nav_area ul li { border-width: 0; margin-bottom: 0; padding-bottom: 0; background: none; }
.custom #title_area { background: none; padding: 1em 0; border-bottom: none; }
.custom #header { border-bottom: none; }
/*Attaching an image/logo in the header*/
.custom #title_area { background: none; padding: 1em 0 0.5em; border-bottom: none; }
.custom #header {border-bottom: none; height: 165px; padding-top: 0; padding-bottom: 0; background: url(images/sec-live-news-logo.png) top center no-repeat;}
.custom #header #logo { display: none; }
.custom #header #tagline { display: none; }
Thanks so much for your help – trying to get this to work is driving me crazy!
crap… the function didn’t show up, here it is again (hopefully using /* and /* will make the code show up)
/*
my_header{
}
*/
guess that didn’t work either – so I’ll just take out the but everything else should be what I tried to use
my_header{
div id=”header”
a href=”http://www.SECLiveNews.com” rel=”nofollow”><img src=”http://www.SECLiveNews/wp-content/themes/thesis/custom/images/sec-live-news-logo.png”//a
/div
}
Sorry for cluttering up the board, hope you can make sense of this
Actually the code I had written attaches the logo as a background image. I would get rid of that CSS block altogether, but keep these lines (which get rid of the Logo and Tagline:
.custom #header #logo { display: none; }
.custom #header #tagline { display: none; }
Your custom_function.php function should then work. If it still doesn’t work once you’ve applied these changes, let me know and I’ll look more into it with Firebug.
Thanks!
For whatever reason I still couldn’t get it to work… I deleted what you said in the .css file and I tried just copy/pasting the function exactly as you wrote it to the custom_functions.php file, but it didn’t work. I’m not sure what exactly I should be changing… but I want to link the image to http://SECLiveNews.com and the logo is located in the thesis/custom/images folder and is called sec-live-news-logo.png
OK I think I figured out how to make it work – I added the add_action before the function instead of after. Now I just have to figure out how to get the image centered and the extra empty space in above and below the image removed…
Actually it seems to be showing fine in my browser. I looked at it on firefox and camino. Which browser are you using?
I was able to fix the space above and below by adding back in some of the .css code that I had taken out. For whatever reason though the image has shifted a little to the right now, where before it was centered between the Home tab and the RSS Subscribe icon. Thats not really a big deal, but I’m looking around to see if I can move the image to the left slightly.
But the rest of it looks great and I’m so glad I was able to get the image to become clickable… thanks sooo much for your help!!!!
That’s great!
To center your image, just add an ID attribute in your tag so that you can style it with css.
Then go as follow in your custom.css page:
.custom img#ID(your img ID attribute) { float: center; }
If you need padding you could add it there too.
That should do it!
I dont’ know how you know all this stuff off the top of your head, but I’m impressed… so I added id=”SEC” right after the img src=”seclivenews.com/wp-content/themes/thesis/custom/images/sec-live-news-logo.png” in my function created in custom_functions.php.
Then in the custom.css this is what I’ve got:
.custom img#SEC {float: center;}
That didn’t seem to do anything so I’m not sure if I got the syntax exactly right.
Hey Dan,
Hmm… well there’s another thing which you can try.
First, add a new div in your function in custom_functions.php:
my_header{
div id=”sec”
the existing line of code
/div
}
Then in your CSS page, add this:
.custom #SEC { margin-left: auto; margin-right: auto; }
If the margin attributes don’t work, try changing it for float:center;
btw, I’m by no means a programmer. I’m still learning that stuff and still go through a lot of trial and error before getting it right! Working on your thesis code is really good practice.
eh… still can’t get it. not really a huge deal either way, so don’t worry too much about it, but if you think of anything else let me know. just remember that even though you’re not a programmer you’re still about 100 times better than me so anything you tell me try to make it as basic and specific as possible. Thanks for all your help!
Right, I got a quick fix that will work – just tried it with firebug. I don’t think it is the best way to do this, but eh, it does the job. If anyone else has a suggestion to help Dan, please get in touch!
In the meantime:
You already have a .custom #header line of code in your custom.css sheet. Just add this attribute to it:
padding-left: 5px; (or any other value that suits you)
Awesome that does the trick! Doesn’t really matter if its the best way or not – it looks good to me… can’t say thank you enough!
For some reason after applying:
.custom #header #tagline { display: block; }
It did not remove ‘hide’ the tagline.
The main logo for the site I wanted to wrap that also in a H1 tag that also uses an alt text so it would a) code for img b) url for site c) h1 tag b) alt or anchor text.
a) and b) are obviously already in place.
I see you have answered some of the questions in the comment.
You have shown Dan how to make the header clickable, this is esentially what I want to achieve. By getting rid of the logo and the tagline but replacing what is in the tagline within the header image therefore the H1 and anchor text is there in the source code for the SE spiders.
thanks
Azzam
Hey Azzam,
So are you good with the code Dan has used or do you need some help figuring out how to fix your header?