Most popular media in pages or postes?


#1

Is possible to integrale Most popular Media in Posts and Pages similar to the widget Funktion?


#2

Hello @Jan,

Yes. It is possible to get most popular media in Posts and Pages with Rating [rtMedia PRO feature].
You need to write custom query to make a widget that will show popular Media in Posts and Pages.


#3

got rtmedia pro
but how does this work?


#4

Hello @Jan,

The following code will get the popular media list:

$rtmediaModel = new RTMediaModel();  
    $media_popular = $rtmediaModel->get( array(), false, false, $order_by = 'ratings_average desc' );  
    foreach( $media_popular as $media ){  
        ?>  
          
              
          
        <?php  
    }

#5