Using The WordPress Search Box To Search Ebay Listings

Published on 11th August 2008

Hi everyone.

Whether you are new to phpbay or you are an advanced user you will know how annoying it is to have a search box in your wordpress site that will only search your pages and posts, this is a particular problem when your site is more ecommerce based than blog based. A solution was published to this but since the version of phpBay was upgraded you will have found that the origional search.php mod no longer works with the newer versions......until now! If you have been keeping an eye on the forum you will notice that Wade has posted the instructions for this mod to work with phpbay pro version 3.0 and above.

You can see the instructions here or get them from below:

################################################
Getting Your WordPress Search Box To Search eBay Listings............BACKUP YOUR FILES!
################################################

To edit the search.php file, it's pretty much the same for most of them, but sometimes they are a little different.

Open up the search.php file.

Look for this line: <?php if(have_posts()) : ?>

This is where I typically start the paste of the search code.

Scroll towards the bottom and find this line: <?php endif; ?>

This is almost always where the end of the code is to paste over. So we have the start and end point of where the search code will be copied.

The actual search code, for phpBay 3.x is:

###############################################

<p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p>
<p>
<?php
function phpBaySearch($term) {
$keyword = $term;
$category = "";
$text .= '[phpbay]' . $keyword . ',20,' . $category . ', ""[/phpbay]';
echo phpBayPro($text);
}
phpBaySearch($_GET["s"]);
?>
</p>

##############################################

So, to add this search, just copy the search code directly above, then in the search.php file, paste it over the existing code, starting from:

<?php if(have_posts()) : ?>

to

<?php endif; ?>

You actually overwrite these to lines, the start and the end, and everything in between.

Save and upload, then try a search query. This should work for most themes.

This should work with most wordpress themes, but please please as always remember to backup any files before you start editing, its really simple, just change the filename to search.php,bak and if all else fails you can resort to the original file.

Good luck!

Similar Posts Which May Be Of Interest:

Did you enjoy this post? Your friends may do too, so why not share it!

  • Digg
  • del.icio.us
  • StumbleUpon
  • Twitter
  • Facebook

About the Author Ben Johnson

Ben has written a total of 171 articles so far!

Thank you for taking the time to stop by my blog. I am the proud creator and owner of Affiliate Wizard which incorporates Ben Jonson's Blog. I have created this blog to teach you some of the tips and tricks I pick up and perfect in affiliate website development and internet marketing as I build my business online.

Stay updated with the latest articles, news and tips by subscribing to our feed via RSS or Email to receive instant updates.

Never miss another post again, subscribe for instant updates!

  • Google Bookmarks
  • RSS
  • Feedburner
  • Twitter_Follow
  • Facebook_Follow

Affiliate Disclaimer:

Please be aware that this blog contains links to products which I am affiliated with, by clicking on and purchasing any of the products I recommend, Affiliate Wizard LTD may earn a commission. However, you will ONLY ever find me affiliating with products and services which I personally use/have used with good results.

Only One Comment So Far - Let Us Know Your Thoughts!

  1. ok says:

    good site izsabz

Leave a comment

Copyright 2010 Affiliate Wizard Ltd. All Rights Reserved.