Thank you for sharing the access details.
The ordering by the 'ano' field through the view's order settings isn't possible because this list is getting generated by two nested views and the source of the parent view results in not just a single post but multiple.
This needed a workaround and custom code and here are the steps, that I took:
1. To keep the HTML structure of this list minimal, I removed the ul and li tags from both these views ( i.e. 'GICOT Investigadores JCR' & 'GICOT JCR' ).
Also checked the option 'Disable the wrapping DIV around the View' in both of these views.
2. Wrapped the actual output of the list items from the child view 'GICOT JCR', in a special div container with class 'sortable-item' and year field's value, in the 'data-index' attribute:
( screenshot: hidden link )
<div data-index="[types field='ano'][/types]" class="sortable-item">
........
</div>
3. Wrapped the shortcode of the parent view inside a div container with class 'sortable':
( screenshot: hidden link )
<div class="sortable">
[wpv-view name="GICOT Investigadores JCR" wpvgrupoinvestigacion="gicot"]
</div>
The goal was to achieve this HTML structure for the list items so that a custom script can be used to order them based on the year value coming from the 'ano' field in the 'data-index' attribute:
<div class="sortable">
<div class="sortable-item" data-index="year-value">...</div>
<div class="sortable-item" data-index="year-value">...</div>
<div class="sortable-item" data-index="year-value">...</div>
<div class="sortable-item" data-index="year-value">...</div>
</div>
4. The last step was to include some custom script in the parent view, to make this ordering work:
( screenshot: hidden link )
jQuery(document).ready(function( $ ) {
$('.sortable').each(function(){
var $this = $(this);
$this.append($this.find('.sortable-item').get().sort(function(a, b) {
return $(b).data('index') - $(a).data('index');
}));
});
});
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/