1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HowTo: Add XenForo Latest Resources to WordPress Theme

Show the latest updated resources on the WordPress side of your site

  1. Albert
    If you purchase the XenForo Resource Manager, then you might want to show the latest updated resources on the WordPress side of your site.

    Use the following code:

    PHP:
    1. <?php
    2. /* Script to pull the latest updated resources from the XF Resource Manager*/
    3.  
    4. /** @var $resModel XenResource_Model_Resource */
    5. $resModel = XenForo_Model::create('XenResource_Model_Resource');
    6. $fetchOptions = array(
    7. 'limit' => 5,
    8. 'order' => 'resource_date',
    9. 'direction' => 'desc'
    10. );
    11.  
    12. $rmupdates = $resModel->getResources(array(), $fetchOptions);
    13.  
    14. foreach ($rmupdates AS $rmupdate)
    15. {
    16. echo ("<div class='entry-meta'><a href='/community/" . XenForo_Link::buildPublicLink('resources', $rmupdate) . "' >" . $rmupdate['title'] . "</a> Downloaded: " .$rmupdate['download_count'] . "<br /></div>"); // Echo the title with a link.
    17.  
    18. }
    19.  
    20. ?>
    21.  
    Resource Manager on WP Side.png