This has bugged me for years and would take minutes on the part of the authors to resolve. There should be an option at the very least, under ‘Screen Options’ to do that.
And it should include an option to view the images in the gallery newest first as well, as one may be adding to an already large gallery.
Failing anything else please give us some code to put in functions.php to resolve it.
Add this to your theme’s functions.php
// change default order in ngg to newest first
add_filter('ngg_manage_galleries_items_orderby', 'set_ngg_orderby');
add_filter('ngg_manage_galleries_items_order', 'set_ngg_order');
function set_ngg_order($order) {
return 'DESC';
}
function set_ngg_orderby($orderby) {
return 'gid';
}
It will change the order to newest first. BUT it won’t change the order of photos within a gallery. Nor will it change the order in the drop down list in “Import from WordPress Media Library”
If anyone knows how to do that, or knows what the hooks are, please tell.
-
This reply was modified 8 years, 9 months ago by
digbymaass.
Thanks for that, it does indeed fix the sorting on the “Manage Galleries” page. I’d managed this before, but the changes I made were in the gallery code and always got overwritten each time it updated. This should persist now given the changes are in the theme files.
Hopefully the authors can take a moment to add some global sorting options that will solve this issue once and for all. I still have a long way to scroll in the select lists…
Cheers!
Plugin Contributor
Imagely
(@imagely)
I’ve done that in the past.
The people with few and small galleries obviously far outweigh those with many and large ones.
Is there a way of automatically showing images newest first in galleries when managing a gallery, using something in functions.php?
-
This reply was modified 8 years, 9 months ago by
digbymaass.
Plugin Contributor
Imagely
(@imagely)
@digbymaass – Let’s have a separate conversation in a new topic or feel free to use our contact form. Interrupting other topics will not help congeal your ideas or provide them with any additional momentum.
If you have submitted a PR then that is the best approach currently; if you are looking for something different, please start your own topic so we can try to help you with your specific issue on your specific site.
See https://make.wordpress.org/support/handbook/forum-welcome/#post-in-the-best-place
Thanks!
– Cais.
It was absolutely relevant to the topic. I have EXACTLY the same issue as the OP. Please deal with the issue.
In addition to that, I posted about this previously in another thread and was told to create my own topic so I did. Now I need to submit pull or feature request?
Is this request just not possible? I’m fine with that, I’m just not sure why there’s the run-around.
Plugin Contributor
Imagely
(@imagely)
@wpngguser – Doing all of the refactoring that may be required to change the interface is possible, although a forum topic here does not carry as much influence as a PR or Feature Request could. Either of those venues will go into our support platform; and, are part of our release planning references.
We do hear these requests and although we also see their potential benefits we weigh all feature request ideas against all other contributing factors such as existing issues, planned enhancements, and significant new feature sets when scheduling our developers’ time.
Thanks!
– Cais.