Using a fairly standard mediaPress install. My users want to see their newest images first, whenever they open a gallery. Seems reasonable.
I don’t see anywhere to set this as an option in the admin settings eg; a newest/oldest first checkbox or similar, (which is where I’d expect it). Just to be clear, this is not a custom query/page or anything like that, I’m talking about just the standard profile gallery views. Perhaps I’m looking in the wrong place, or there’s another, simple, way to do this which I’ve not found yet.
Helpful suggestions appreciated.
Yay, perfect, and a nice demonstration of how to modify the MPP core behaviour from a local plugin too.
Thanks Ravi!
R.
- This reply was modified 6 years, 10 months ago by Richard Foley.
It’s a bad idea. Will break the order for sorted gallery.
Ahh I see it now,
Ignore my last reply. It’s good to go and will work. This filter fires way before we test for sorted gallery and sorted gallery will automatically override it.Thank you Ravi.
Regards
BrajeshI want to use this reply to order the media by title on the gallery display in my WordPress site royalenfieldclub.nl (see https://leden.royalenfieldclub.nl/archief/fabriek-doc/5/#1930-1939).
But in which file do I put the code and where in the file? (PS I don’t use Buddypress itself , just Mediapress).function buddydev_modify_media_order( $args ) { $args['orderby'] = 'title'; return $args; } add_filter( 'mpp_main_media_query_args', 'buddydev_modify_media_order' );
greetings,
HollyHi Holly,
Thank you for using MediaPress.you may put the code in your theme’s functions.php
Regards
BrajeshWhen I put it in my theme’s functions.php I see no change in order on the document’s gallery page ( https://leden.royalenfieldclub.nl/en/archief/fabriek-doc/ ), which is also paginated ( [mpp-show-gallery id=2292 status:”loggedin” search_terms=’1940′] etc. ).
What could be the cause of that?
greetings,
Holly
You must be logged in to reply to this topic.