PDA

View Full Version : Change search button in wordpress?




giganten
Dec 18, 2007, 06:50 AM
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
Dec 18, 2007, 07:00 AM
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
Dec 18, 2007, 07:19 AM
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
Dec 18, 2007, 04:01 PM
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
Dec 18, 2007, 04:22 PM
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
Dec 18, 2007, 06:02 PM
Thanks.
child pixels / parent pixels = child em. Works perfect now.

rhyndu
Dec 18, 2007, 08:32 PM
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
May 29, 2009, 04:40 PM
Here is a cleaner way to do it:

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