WordPress IDX Integration, Radically Simplified (Updated 5/10/10)
Let's Face It - WordPress Is Hot!
For all of you WordPress junkies, we're now serving WordPress Websites!
Many Real Estate folks are using it at least for their blog, if not managing their entire website with it. So, it only makes sense for us to integrate with it, right? We also offer Complete WordPress Websites, for those of you that don't want the technical challenges of setting up your own WordPress installation.
Where Do I Start?
First, our WordPress integration is still new. It works, but if you run into trouble,
we'll help you through and fix it.
Second, you need to have a
basic understanding of our API
because many of the same concepts are used. Please do check it out. Go ahead - I'll wait...
Install The Necessary Plugin (Updated)
In WordPress technical terms, our service isn't the plugin. We use a third-party plugin that's been around for a while, so it's stable and proven. We're just using it in a novel manner. It's called WP Web Scraper, and you can either download it separately or install it directly from within your WordPress setup. You need version 2.2, so if you've already installed previous versions, please update to this version.
And yes, I know that the author uses both "Scraper" and "Scrapper". He's from India. I think his English is much better than my Hindi, so I'll forgive it. Part of the beauty of the WordPress community is its diversity!
The WP Web Scraper plugin does require PHP5 (WordPress is written in PHP, a web programming language). Most webhosts have both PHP4 and PHP5 available. You shouldn't have to be concerned with this unless you see an error similar to this during the installation/activation:
Plugin could not be activated because it triggered a fatal error. Parse error: parse error, unexpected T_OBJECT_OPERATOR in /wp-content/plugins/wp-web-scrapper/wpws_index.php on line 173
If you see that error, please consult your webhost to find out how to make PHP5 your default version. You'll probably need to uninstall the plugin, fix the PHP version, then reinstall/reactivate it.
Look Ma - No Frames!
With the handy plugin above, our IDX services become part of your WordPress website! No frames, no Ajax calls - completely part of the page, so it's search-engine-friendly, fully indexable and takes on the styling of your website. It can be added to either Posts or Pages. Plus, we're able to pass through some of our standard calls-to-action and have them pass directly back to ListingWare.
First, you'll need to create a blank Post or Page in WordPress. The name isn't critical. This sets up the standard Search Criteria > Search Results > Listing Detail process flow. To understand this flow, you can check out this example WordPress installation and start with the Search option. (Atlanta area search, so cities like Roswell, Decatur, Atlanta, Douglasville will work.)
After you add the Post or Page, go back to Edit mode of the Post/Page and take note of the 'post=N' value in your browser's address bar. This is not the Permalink value, but the actual browser address bar where you see the URL of the page you're on. This is important, because you'll be using the number 'N' to create the following value later:
p=N (if added to a Post) or page_id=N (if added to a Page)
You can create as many Posts or Pages as you like, each with its own p/page_id parameter. It is important to pay attention to whether you're adding a Post or a Page, as WordPress handles each differently. If you want to offer several different types of display, you can have each one setup to use different default values as described below. Just make sure you include the separate p/page_id value so the system will know where to pass listing info to.
Almost Ready...
Now that you have the p/page_id value, you can go back and add content to the blank Post or Page.
This uses a concept in WordPress called
Short Codes.
Make sure you place the WordPress page editor in HTML mode.
Visual mode may produce odd display results.
Please note the url field below uses a format like what is created with standard API calls. You'll substitute your URL for 'yourname.servicename.com' below, and change the values of p/page_id to what you got in the step above. Finally, make sure you start with the left square bracket, followed by 'wpws', and end with right square bracket. It's all needed for the plugin to function properly. The url field should not have any spaces.
Lastly, you'll want to keep a bookmark on the Usage Manual of WP Web Scraper. As noted there, the url and selector parameters are required by the plugin. For our use, we also require the user_agent parameter to be "WordPressFeed" and the output parameter to be "html". These make sure the format is correct to work inside your WordPress pages.
OK, Let's Go!
Let's say you want to create a Post about the city of Roswell (Note the 'p=N'). You can put whatever content you want in the Post, then add this:
[wpws url="http://yourname.servicename.com/search/index.cfm?City=Roswell&p=N&___QUERY_STRING___" selector="#lwcontent" timeout="15" cache="5" user_agent="WordPressFeed" output="html" urldecode="0"]
The City parameter should be familiar from the standard API. You can add any combination of specific API parameters you want to get specific search results.
Please Note - Key Difference from API! The new parameter of WordPressStart tells our system where to start the process. This method is instead of using the individual page names of the standard API - everything funnels through '/index.cfm'. WordPressStart=Search is the default and it's assumed. If you want to feed directly to the search results, you can use WordPressStart=Results, like below.
[wpws url="http://yourname.servicename.com/search/index.cfm?City=Roswell&WordPressStart=Results&p=N&___QUERY_STRING___" selector="#lwcontent" timeout="15" cache="5" user_agent="WordPressFeed" output="html" urldecode="0"]
Something More Complex
To create a Search Page that takes user input, use the following pattern (Note the 'page_id=N'). It defaults to a City search, but if you also include the KeyField API parameter, you can make it use the various key search fields.
[wpws url="http://yourname.servicename.com/search/index.cfm?page_id=N&___QUERY_STRING___" selector="#lwcontent" timeout="15" on_error="Could not display search page. Please try again." cache="5" user_agent="WordPressFeed" output="html" urldecode="0"]
Please note the part about 'QUERY_STRING'. This is the key element and must be in the following format:
&___QUERY_STRING___ (ampersand sign, three underscores, QUERY, underscore, STRING, three underscores)
That's it, but it's key. This parameter is so that you can take dynamic input from the Search page fields and pass them through to ListingWare without having to track each individual field. QUERY_STRING just grabs everything.
We're also working on integrating the Map, Gallery, and Flow results style.
WordPress integration is a work-in-progress. If you have any questions, concerns, or ideas, please send email to support [at] listingware.com. We'll be glad to see if we can assist.
P.S. This page was first published on March 30th, 2010. Any other IDX vendors that come out and say "Ooh, look at us! We're using WP Web Scraper too!" Well, they're just copycats. The plugin is free, but that's just part of the equation. I don't really think they can make it happen anyway, because they'd have to have our API, which they don't. So there. Bob...
Only softRealty CreativeRoof has even seen this so far, and we like those guys.
Abundance Theory, right?

