RTmedia Pro Attachment on Topic


#1

Helloo…

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 ?


#2

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.


#3