how do you limit the number of activity river items to 6?

I want to limit the activity river items to 5

  • Where exactly you want to show this? In activity feed or user widgets?

    You can set the limit by passing limit parameter as 5 in elgg_list_river() API

  • <?php
    
    function myplugin_set_river_limit($hook, $type, $value, $params) {
      // like adding ?limit=6 to the URL
      set_input('limit', 6);
    }
    
    // execute just before the river page resource view is rendered.
    elgg_register_plugin_hook_handler('view_vars', 'resources/river', 'myplugin_set_river_limit');

    Try this out. For Elgg 2.0+