Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

giganten

macrumors 6502a
Original poster
Jan 23, 2006
602
0
I want to change the search button on my theme I am creating.
So I did use this in the searchform.php:

<input type="image" src="images/search.gif" id="searchsubmit" value="Search" />

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

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
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.
 

giganten

macrumors 6502a
Original poster
Jan 23, 2006
602
0
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"..
 

giganten

macrumors 6502a
Original poster
Jan 23, 2006
602
0
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..
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
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..

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.
 

giganten

macrumors 6502a
Original poster
Jan 23, 2006
602
0
Thanks.
child pixels / parent pixels = child em. Works perfect now.
 

rhyndu

macrumors regular
Dec 17, 2007
170
0
A Planet Orbiting Sol!
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"..

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!
 

lukesdyer

macrumors newbie
Apr 9, 2009
2
0
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" />
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.