Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts

    button in header only showing up on homepage

    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?
    Attached Thumbnails Attached Thumbnails button in header only showing up on homepage-home-page-header.png   button in header only showing up on homepage-about-page-header.png  

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Posts
    271
    Thanks
    3
    Thanked 40 Times in 40 Posts
    We would need more info. What is the url?

  • #3
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    educatedpenguin.com

  • #4
    Regular Coder
    Join Date
    Jan 2009
    Posts
    193
    Thanks
    0
    Thanked 20 Times in 20 Posts
    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
    Code:
    #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
    Code:
    #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;
    }

  • Users who have thanked skywalker2208 for this post:

    cozart (08-17-2010)

  • #5
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    ugh. stupid mistake. in the stylesheet i had

    Code:
    height:20;
    width:20;
    instead of

    Code:
    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.

  • #6
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    The bubble is actually out of place on the home page - caused by this:

    Code:
    <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.

  • Users who have thanked SB65 for this post:

    cozart (08-17-2010)

  • #7
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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:

    Code:
    <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:

    Code:
    <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?

  • #8
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    Wordpress includes a conditional tag is_home() which should do what you want.

  • Users who have thanked SB65 for this post:

    cozart (08-18-2010)

  • #9
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    excellent! this is what i ended up with, which works perfectly.

    Code:
    <title><?php if (is_home()) { bloginfo('name'); }  else { bloginfo('name') ?> | <?php wp_title(''); if(wp_title('', false)); } ?></title>
    thanks so much for the help!


  •  

    Posting Permissions

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