PDA

View Full Version : button in header only showing up on homepage



cozart
Aug 17th, 2010, 03:27 PM
this one i don't get. my "spotlight" search button is only appearing in the header on my homepage, and not on the other pages of my site. they all pull the same header and they all show the search box, but for some reason the button is missing altogether.

any ideas as to what could be causing this?

jimhill
Aug 17th, 2010, 04:18 PM
We would need more info. What is the url?

cozart
Aug 17th, 2010, 04:22 PM
educatedpenguin.com

skywalker2208
Aug 17th, 2010, 04:33 PM
I notice the css on your homepage and other pages is different for that section. One has a width and height and the other doesn't.

Other pages


#topSearch input[type="submit"] {
background:url("images/spotlight.png") no-repeat scroll 0 0 transparent;
border:medium hidden;
bottom:2px;
cursor:pointer;
position:relative;
}


Home page


#topSearch input[type="submit"] {
background:url("images/spotlight.png") no-repeat scroll 0 0 transparent;
border:medium hidden;
bottom:2px;
cursor:pointer;
height:20px;
position:relative;
width:20px;
}

cozart
Aug 17th, 2010, 04:42 PM
ugh. stupid mistake. in the stylesheet i had


height:20;
width:20;

instead of


height:20px;
width:20px;

that's what was causing the button to not show. however, now the search bubble shifts to the left on the other pages, but is correct on the home page.

SB65
Aug 17th, 2010, 08:26 PM
The bubble is actually out of place on the home page - caused by this:


<title>Educated Penguin</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">


appearing before your doctype. Moving the title tag causes the bubble to shift to the left in line with the About page etc.

cozart
Aug 17th, 2010, 11:03 PM
ok, got that figured out. but that, of course, brings up another issue with the way titles are displayed in browser tabs and at the top. I want the homepage to just be the title of the site, but I want child pages to read:

SiteTitle | Page

i've used this bit of code before:


<title><?php wp_title(''); if(wp_title('', false)) { ?> | <?php } bloginfo('name'); ?></title>

but that results in: Page | SiteTitle on child pages.

so i tried rearranging the code to this:


<title><?php bloginfo('name') { ?> | <?php } wp_title(''); if(wp_title('', false)); ?></title>

but that gives me a syntax error of an unexpected {

if i add the semi-colon after ('name'), child pages come out correct, but the home page displays

SiteTitle |

any ideas what i'm doing wrong and how i can get this to work how i want?

SB65
Aug 18th, 2010, 09:03 AM
Wordpress includes a conditional tag is_home() (http://codex.wordpress.org/Conditional_Tags) which should do what you want.

cozart
Aug 18th, 2010, 02:58 PM
excellent! this is what i ended up with, which works perfectly.


<title><?php if (is_home()) { bloginfo('name'); } else { bloginfo('name') ?> | <?php wp_title(''); if(wp_title('', false)); } ?></title>

thanks so much for the help!