Change search button in wordpress?

Discussion in 'Web Design and Development' started by giganten, Dec 18, 2007.

  1. macrumors 6502a

    Joined:
    Jan 23, 2006
    #1
    I want to change the search button on my theme I am creating.
    So I did use this in the searchform.php:

    But I only get an empty box. What should I do, some other file I need to change too?
     
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    The code you have seems fine, though I don't use Word Press so not sure if that's the right spot to change it. I would make sure you uploaded the graphic and the src is pointing to the right spot. Also O'd check what CSS is being applied to that element.
     
  3. thread starter macrumors 6502a

    Joined:
    Jan 23, 2006
    #3
    I had to use "http://localhost/wordpress/wp-content/themes/style/images/sok.gif" to get it to work.

    But in the other files I just use images/"name"..
     
  4. thread starter macrumors 6502a

    Joined:
    Jan 23, 2006
    #4
    I will ask a new question.
    This time about font-size I use em's, but I get different sizes on the pages and the "blog" part. The headlines in the Blog are like 4-5 times bigger. Anyone know what the problem can be?

    Edit: when I have the blog headlines as links they get bigger but if I just use text it stays normal..
     
  5. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    The thing with em's is that the cascading part of style sheets. That means if you set p tags to 1.2em and the strong tag to 1.1em, the text in the strong tag will be 1.32em because it makes use of its parent font-size as well as its own (1.2 * 1.1 = 1.32). So check how those font-sizes get cascaded and that should reveal where the issue is coming from.
     
  6. thread starter macrumors 6502a

    Joined:
    Jan 23, 2006
    #6
    Thanks.
    child pixels / parent pixels = child em. Works perfect now.
     
  7. macrumors regular

    Joined:
    Dec 17, 2007
    Location:
    A Planet Orbiting Sol!
    #7
    The reason for this (if you care:p) is that that file is being accessed through /index.php, so relative to the browser and user (the people who count in the world of web paths) they are seeing http://**WP-SITE-NAME**/images/"name
    . The other files worked because the browser was accessing the URL **WP-SITE-URL**/wp-content/themes/your-theme/file.php so relative to file.php, it works ;)

    Sorry if my explanation doesn't make any sense!
     
  8. macrumors newbie

    Joined:
    Apr 9, 2009
    #8
    cleaner way to do it

    Here is a cleaner way to do it:

    <input type="image" src="<?php bloginfo('template_directory'); ?>/images/search.gif" id="searchsubmit" value="Search" />
     

Share This Page