[wp-pro] Remotely Connecting to a Category

Mike Devarenne mike at swampsidestudio.com
Tue Apr 27 20:02:30 UTC 2010


wp-pro at lists.automattic.com,

I'm more of a designer and front-end developer, and I have a WordPress
project that is posing a challenge on the back end. Please contact me if you
can help.

There are three sites: A corporate site with a product catalog, promotional
craft site 1, and promotional craft site 2. I want to create the product
catalog once on the corporate site, then display the product catalog on the
two craft sites.

What I hope to do is to tell craft site 1 and craft site 2 to use a remote
database when displaying the product catalog category. It should behave sort
of like a category template in an iFrame, pulling content and category
navigation from a remote site.

Right now the three sites are all on the same server with separate domain
names, separate WordPress installations and separate databases.

I considered WPMU, but have never used it, and I assume it would still
require custom database calls. Also, as I understand it WPMU is for having
sites with different content on the same server installation. What I want is
the same content (for one category) on multiple installations.

I am able to connect to the external database using this
http://wordpress.org/extend/plugins/hyperdb/, with these instructions
http://www.dnxpert.com/2010/04/18/loading-posts-from-two-wordpress-databases/.
I can load a list of the posts from the external database in a category
template, but all the images and links to the posts are broken because the
hrefs are for the local site when they should be for the remote site. Also,
none of the paging or child category navigation works. But then if I were
able to change the WP_SITEURL for that category template so the images show
and the paging works, any click by the visitor will take them to the remote
site -- which I don't want.

Here are some references I've looked at:
http://www.tyssendesign.com.au/articles/cms/connecting-to-external-database-from-within-wordpress/
http://wordpress.org/support/topic/249491
http://wordpress.org/extend/plugins/external-database-authentication/
http://wordpress.org/support/topic/307945
http://wordpress.org/support/topic/275658?replies=9#post-1089293
http://wordpress.org/support/topic/296829?replies=3#post-1359860
http://codex.wordpress.org/wpdb
http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query#Query_based_on_Custom_Field_and_Category
(see
“This example, tested Wordpress 2.9.2, is made to get posts in selected
categories…”)
http://vasir.net/blog/php/displaying-wordpress-posts-on-external-pages-getting-posts-by-category-or-tag/
http://wordpress.org/support/topic/360895

Please let me know if you have any recommendations on how best to
proceed, need any further information, and if you think you can help.

Thank you!
____________________________
Mike Devarenne
Swamp-Side Studio, LLC
Website Design and Development
swampsidestudio.com
616-443-1476
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-pro/attachments/20100427/d258e0fd/attachment-0001.htm>


More information about the wp-pro mailing list