Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

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

[SOLVED] Displaying a Google Search Engine?


  #1  
Old May 1, 2012, 07:26 PM
GRF
 
76 posts · Mar 2011
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, 09:14 PM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what version of Atahualpa and WP?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old May 1, 2012, 10:32 PM
GRF
 
76 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 11:24 PM. Reason: Fixed it, I think
  #4  
Old May 2, 2012, 06:22 AM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old May 2, 2012, 08:06 AM
GRF
 
76 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 08: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 12:23 PM
Search engine visibility pilsen1 Header configuration & styling 1 Oct 30, 2009 10:49 AM
Articles not in search engine Google AmpLiF1eR Excerpts, Read more, Pagination 2 Oct 16, 2009 05:57 PM
Linking pages for Search Engine Optimisation Leoni Atahualpa 3 Wordpress theme 4 Jun 1, 2009 10:59 PM


All times are GMT -6. The time now is 02:10 AM.


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