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.

I am integrating a Wordpress template with Buddypress (with bbPress included).

I would like to automatically create a post for popular forum topics so that it will show in my main page. I am hoping this can be done with popular products as well, with a post title like "Hot Product" etc.

Could someone please tell me if this is possible and how it can be done?

Thanks you so much in advance!

share|improve this question

closed as off-topic by kaiser Aug 4 at 14:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

I am not familiar with bbpress, but I think that first you need to get the forums in your site and then you need to loop through its topics to obtain the topic that matches your criteria of popular topics. You can search in the docs or source code to find the functions and methods that might help you with that. get_forums() for example might help.

Once you get the popular topic, you will have to fetch the data that you need from it and use this data in constructing the post using wp_insert_post() function. This answer will help building your function and hooking it to the appropriate WP action.

share|improve this answer

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