It's been about a week since my last addition to the phpBay extended manual. My intention was to post a new piece of the manual each day until completion, but you know how things go. I've been quite busy. And, well, I'm going a bit out of order as well. I was going to write about phpBay keyword tracking, and I still will, just not today. I'll get to it soon enough.
This post covers inserting phpBay code into theme files. I came up with a cool idea for using it and thought I'd share it. I have a couple blogs that are 99% hands off, and have automated content, and I wanted a way to insert some auctions to the end of the posts without having to do it manually. Doing it this way you will end up with exactly the same auctions at the end of each post, which won't be as targeted, but it's still proven to work.
You could add some extra php code to show different auctions based on the current category, but I won't get into that here. If I get enough requests in the comments I'll edit this post.
This will be handy if you have an auto-blog on one main topic. I'm sure you can think of some other applications for it, this is just one purpose.
Look through the table of contents below if you want to jump to a different section first. Below the TOC are the quick steps to add phpBay code to your theme files.
Table Of Contents
- Introduction
- Installation/Activation
- Configuration
- Testing
- Per-Post/Per-Page Settings
- Geo-Targeting
- Making The Images Clickable
- Replacing Wordpress Search With eBay Search
- Inserting phpBay Code Into Theme Files
- Buy phpBay Pro (20% off coupon: DA9CD69F42)
- From Picking A Market To Building/Managing Your phpBay (Or BANS) Site
Remember, phpBay has a sidebar widget you can use, but if you want more control, and want to add auction listings to the bottom of all posts, follow these steps...
- In your Wordpress admin panel, go to Appearance -> Editor.
- On the right side you should see a file called Single Post (single.php), click it to open up the file in the editor on the left.
- In this file there should be a command to show the post content. Look for the_content(). Just below that you can insert the phpBay code.
- You can use any and all parameters here just like you would in a post or page, the example below shows just the keyword and the number of posts.
That should do it for you. Tell me some uses you have thought of for adding phpBay code to theme files...
Tags: making-money-on-the-internet, earn-extra-money, how-can-i-make-money, extra-income, extra-money
Related posts:
- phpBay Pro: The Extended Manual – Replacing Wordpress Search
- phpBay Pro: The Extended Manual – Making The Images Clickable
- phpBay Pro: The Extended Manual – Testing
- phpBay Pro: The Extended Manual – Installation and Activation
- Your Question Answered: Keeping Waiver Sharks In The Loop – WPAds Code For Templates














Enter your first name and email address below to receive exclusive money making tips.


November 25th, 2009 at 11:13 am
Hi, I would love to use categories as the keywords for phpbay pro. I am testing to see how much you can make with a site that is on autopilot. If you could help with this, I would be forever grateful and would consider making a donation in return for your help.
November 30th, 2009 at 12:33 pm
Hi Chantel,
You can use php code in the single.php file to check the category ID and then write phpBay code with your chosen search keyword based on the category. I’ll send you the code in a text file…
December 29th, 2009 at 11:35 pm
Ya know, this is like the only site on the net where I found out how to do this. Only trouble is, yours is an image, and my rewriting it gives an error. lol
Did you ever post the category specific content way somewhere else? Checked around, but didn’t see it.
Thanks for this!!!
December 29th, 2009 at 11:51 pm
Hi Matt,
Here’s the code…
if ( in_category( ‘1′ )) {
// Insert code here for category 1
} elseif ( in_category( array( ‘cat-name’, ‘other-cat’ ) )) {
// This shows a way to do it using category names (multiple)
} else {
// any other catgeory
}
You can also do it by post using the is_single(‘post#’) command
Hope that helps…let me know if you have anymore questions…
December 30th, 2009 at 1:05 am
Thanks for the speedy reply!
Works great!