RTmedia Pro Attachment on Topic


i was wondering, is it possible to get fist topic image attachment on bbpress topic loop ?
if it is, how to do that ? anyone can help ?

Hi @wawanbrutalx,

Yes, you can fetch media to the first topic. All you need is the topic id, then use following code to get the media.

$topic_id = // forum topic id here
$media_model = new RTMediaModel();
$media_obj = $media_model->get( array( 'context' => 'topic', 'context_id' => $topic_id ) );

It will return the whole media object using what you can retrieve the attached image to the topic.