Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

[SOLVED] Displaying a Google Search Engine?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old May 1, 2012, 06:26 PM
GRF
 
54 posts · Mar 2011
[SOLVED] Displaying a Google Search Engine?

I created a Google Search Engine by using a 2-Page Look and Feel. Meaning I have the search box form code and the search results code. But the Google Search box form code doesn't work. But the regular code on Searchform.php does work, but there is no Watermark displayed in the search input box which I think Google requires. Here is the code. Is there anyway to show the Watermark in the Google search input box? Also, the right and left sidebar widgets don't show when the search results are shown except for the search bar and Recent searches.

Code:
Searchform.php

<form method="get" class="searchform" action="<?php echo esc_url( home_url() ); ?>/">'
<table class="searchform" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="searchfield">
<input type="text" class="text inputblur" value="<?php esc_attr( the_search_query() ); ?>" name="s" />
</td>
<td class="searchbutton">
<input name="submit" value="Search" type="image" src="<?php echo get_template_directory_uri(); ?>/images/magnifier2-gray.gif" style="display: block; border:none; padding: 0 0 0 5px; margin: 0;" />
</td>
</tr></table>
</form>
Code:
Search.php

<?php 
global $options; 
foreach ($options as $value) { 
	if (get_option( $value['id'] ) === FALSE) { 
		$$value['id'] = $value['std']; 
	} else { 
		$$value['id'] = get_option( $value['id'] ); 
	} 
}
if ( is_page() ) { global $wp_query; $current_page_id = $wp_query->get_queried_object_id(); }
?>
<?php get_header(); ?>

<p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p>

<!-- GOOGLE Search results Code Generated by Google is Here -->
			
<?php get_footer(); ?>
  #2  
Old May 1, 2012, 08:14 PM
juggledad's Avatar
juggledad
 
20,147 posts · Mar 2009
OSX 10.6.8/10.7.3 WP 2.8.x/2.9.x/3.x Atahualpa 3.5.x/3.7.x Safari 5.x Firefox 11 XP
what version of Atahualpa and WP?
  #3  
Old May 1, 2012, 09:32 PM
GRF
 
54 posts · Mar 2011
Atahualpa 3.7.3 and WordPress 3.3.1

I think I fixed it.

Changed...

<input type="text" class="text inputblur" value="<?php esc_attr( the_search_query() ); ?>" name="s" />

to

<input type="text" class="text inputblur" value="Google™ Search" name="s" onclick="this.value='';" />

The other thing is, given the Search.php code above do you know why the Widgets on the sidebars don't show and the footer text is messed up? The only thing that shows is the search form and the Recent Posts in the left sidebar.

Here is the page that returns a Google job search: http://www.jobspecialists.net/?s=job...x=0&submit.y=0

Last edited by GRF; May 1, 2012 at 10:24 PM. Reason: Fixed it, I think
  #4  
Old May 2, 2012, 05:22 AM
juggledad's Avatar
juggledad
 
20,147 posts · Mar 2009
OSX 10.6.8/10.7.3 WP 2.8.x/2.9.x/3.x Atahualpa 3.5.x/3.7.x Safari 5.x Firefox 11 XP
use index.php as a basis of your code and it will work, make a copy and call it search.php and put your code inplace of the loop.
  #5  
Old May 2, 2012, 07:06 AM
GRF
 
54 posts · Mar 2011
OK. Thanks. That worked.

Can you please tell me this 1 last thing. I looked at all the theme configuration items and can't for the life of me figure this out.

Just for the posts there is a gap just below the header image in the center and dashed line just before the blog post title.

Can you tell me how to remove it?

Here is the post that shows what I mean: http://www.jobspecialists.net/health-care-jobs/

UPDATE:
Never mind: Found it. It's the center post navigation configuration items. Sorry!

Last edited by GRF; May 2, 2012 at 07:19 AM. Reason: found it myself

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Replace search bar with google search bar frugalmommytoday Header configuration & styling 14 May 19, 2011 11:23 AM
Search engine visibility pilsen1 Header configuration & styling 1 Oct 30, 2009 09:49 AM
Articles not in search engine Google AmpLiF1eR Excerpts, Read more, Pagination 2 Oct 16, 2009 04:57 PM
Linking pages for Search Engine Optimisation Leoni Atahualpa 3 Wordpress theme 4 Jun 1, 2009 09:59 PM


All times are GMT -6. The time now is 12:49 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.