diff --git a/src/tainacan/view-mode-grid.php b/src/tainacan/view-mode-grid.php index 3d79dcc..6de80dd 100644 --- a/src/tainacan/view-mode-grid.php +++ b/src/tainacan/view-mode-grid.php @@ -1,17 +1,30 @@ + $is_slideshow_available = false; + if (function_exists('tainacan_is_view_mode_enabled')) + $is_slideshow_available = tainacan_is_view_mode_enabled('slideshow'); + + function get_item_link_for_navigation($item_url, $index) { + if ( $_GET && isset($_GET['paged']) && isset($_GET['perpage']) ) { + $query = ''; + $perpage = (int)$_GET['perpage']; + $paged = (int)$_GET['paged']; + $index = (int)$index; + $query .= '&pos=' . ( ($paged - 1) * $perpage + $index ); + $query .= '&source_list=' . (is_tax() ? 'term' : ((!isset($collection_id) || empty($collection_id)) ? 'repository': 'collection') ); + return $item_url . '?' . $_SERVER['QUERY_STRING'] . $query; + } + return $item_url; + } +?>