Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] Displaying a Google Search Engine? (http://forum.bytesforall.com/showthread.php?t=17463)

GRF May 1, 2012 06:26 PM

[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(); ?>


juggledad May 1, 2012 08:14 PM

what version of Atahualpa and WP?

GRF May 1, 2012 09:32 PM

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

juggledad May 2, 2012 05:22 AM

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.

GRF May 2, 2012 07:06 AM

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!


All times are GMT -6. The time now is 02:13 PM.

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