Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hopefully this is the easiest question ever asked. I have a WordPress site with BBP installed. I want to be able to pull the latest BBP posts in a php query I can use throughout the site. What is easiest way of doing this?

Any help would be greatly appreciated.

share|improve this question
add comment

1 Answer

If they're in the same DB, it's easy enough. Pull them straight out of the DB using $wpdb. And there might even be a WP plugin or a BB plugin that does this for you.

If they're not in the same DB, but on the same server, you can access them by prefixing the DB table with the DB's name, e.g. mybbpressdb.bb_posts, or something to that effect.

If they're not on the same server, you need to create a new connection, using mysql_connect(), mysqli_connect() or a PDO instance. If you use either of the first two, be sure to use the parameter that makes mysql create a new connection -- else it may discard the one from $wpdb.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.