[Resolved] Looping posts with content from different database
My problem is a bit complicated, but I’m kind of new to WordPress and I’m still learning PHP, so maybe I can’t see the solution yet.
Here’s my situation. I’m running a community forum on which I have a news section. I would like to have a CMS that takes posts from that section and displays them on a website just as most blogs do – with categories, tags and so on, and I think it can be achieved with WordPress (actually I’m almost sure it can, but I’m missing some knowledge to figure out how exactly). I’ve read a lot of tutorials, which gave me some ideas.
To do this, I would have to connect to the forum database and get post data from a table or tables. I tried using wpdb class (new wpdb in my child theme functions, it works great), but is it possible to put this data in a WordPress loop using WP_query? Doing it this way would let me use template tags and give me all the goodness of WordPress (permalinks, search, archives?), the problem is, can the WP_query be used or modified to get certain columns from certain tables in a different database, and treat it as usual post data?
If yes, great, if no, I have a second idea – copying certain forum columns into a separate table in wordpress database and using that data for custom posts. Probably this would be better, but I’m worried about the number of connections to the forum database – is there a way to copy and update this data periodically or when certain tables are updated (like when a new news-topic is published or edited)? Because in the previous case I was hoping that some kind of caching plugin in WordPress would solve it, but here… I’m not so sure.
One thing to note – I’m not thinking about editing these posts in WordPress, I don’t need to do anything with them (although some parsing will be needed, but that is next on my “learn how to do it” list, if this works out), I just need a one way connection.
So… this is it. I was hoping more experienced users can give me advice and point me in the right direction – I would be very grateful for that. Thanks for anything you can share.
- The topic ‘[Resolved] Looping posts with content from different database’ is closed to new replies.