Info
- 5 posts
- 3 voices
- Started 2 years ago by psymatix
- Latest reply from Adam Harley
- This topic is resolved
sorting posts by topic_title
-
- Posted 2 years ago #
Hello,I'm a wordpress user and I just downloaded bbpress for a project I'm working on since I can't get some key features on wordpress. My project involves polls that can be created by users of the site, and also regular forum topics.
I have gotten the polls plugin bbpress polls and it adds '[poll]' in front of the topic title. now I want to use this feature to display topics with polls separately from topics that don't have polls since this seems to be the most distinguishing factor.
My question is how can I get the topic title in the loop for use in my code? the Function topic_title() displays the topic i.e. it echoes it, but I would like to get it as a string that I can use in functions.
Also, I would like to know how I can get a reference of all the index keys in the $topics array so I can use them in my code.
-
- Posted 2 years ago #
Hi,
$query="SELECT topic_id FROM bb_topics";will return the array of the topic ids.
Regards -
- Posted 2 years ago #
Use
get_topic_title()to retrieve the topic title as a string while in the loop.To get the actual index keys of the
$topicsarray, you can usearray_keys, or if you want to actual topic IDs, you'd need to use$topic->topic_idinside a foreach loop assigning$topic. -
- Posted 2 years ago #
thanks. I'm guessing the get_ works for other properties too?
-
- Posted 2 years ago #
Pretty much. The non
get_version is just anechoof theget_one anyway :)http://trac.bbpress.org/browser/trunk/bb-includes/functions.bb-template.php
-
You must log in to post.