![]() |
wordpress gallery image sorting, need help
hey guys,
i got this small problem which piss me incredibly. let's say i got images named 01amateur 02amateur 03amateur etc.. MOTHERFUCKING "gallery" in wordpress sorts it's in completely random order (random order option is not ON ofc..) so in my 1st row i may as well have 05amateur and after it 02amateur etc.. is there any script that i could use or plugin which would sort all my sorted badly images posts according to names? |
most 3rd party plugins, sort by date or manually...
|
ok but it's not what i'm talking about.
if i'll have photos in standard wp gallery named 1.jpg 2.jpg 3.jpg etc.. i wan't those fucking photos to be displayed by this order not randomly. i don't understand why it is fucked up by wordpress?? |
Yeah, that happens a lot and people just "fix" it by using another gallery plugin..
If the randomize button is unchecked in the gallery creation, try just dragging the images around in the order you want. |
Quote:
i don't want to use external plugin only to have my photos sorted properly, it should not be done this way. any idea? any small php piece of code that once ran can sort it out in all posts? should be doeable easily for some1 who know wp and php. i'm offering free annual hardlink on my site to your (best if asian too) site just to thanks for help ;) |
Let me wake up a bit and I'll try to help.
If you use Nextgen Gallery, you would go into nextgen-gallery/lib/ngg-db.php and change this: $album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery") ); to this: $album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery ORDER BY gid DESC") ); or: $album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery ORDER BY title DESC") ); I'm guessing it's the same problem with you where it's going by the image ID and not name, not sure why IDs are all mixed up, though.. :/ |
yes it's using ID's for photos but when i'm adding photos to gallery every single photo has it's own name with growing numbers so anyway it should be sorted as it.
i'm using CyberSeo plugin for harvesting photos from fhgs, i have also custom modified lightbox for displaying photos so if i'll use next gen gallery plugin or any other gallery plugin it will fuck up my theme (i've tried it already) that's why i'm sticking to wordpress built in gallery. and thanks for trying, really appreciate. |
Quote:
|
think he's checking in most WP related topics here, but seriously - it should not be hard for some1 with small php knowledge to write some executable script run manually inside wp folder which will sort out all photos in posts, guess it's only hard for me cuz i'm html only skilled :(
hmm or maybe it could be hard actually? since in every post there are ids but not photo's names? damn it's just strikes me.. could be not doeable due to its nature. |
Quote:
|
shit you got me here.. it's standard built in wordpress gallery function, don't even know which wordpress php file it's been related to :(
|
Quote:
|
thanks a lot
|
you can use the post_gallery hook to modify the output of the gallery, you could alter the default sort pattern.
|
thank you Fris ill google for this hood later today
|
Quote:
[gallery ids="729,732,731,720"] Find more here: https://codex.wordpress.org/Gallery_Shortcode :2 cents: The plugin works just like this: Manual Mode Add a new post or open the existing one and click the “Gallery Magic Shortcode” button (marked with a red square on the picture below). http://www.cyberseo.net/image/img/gallery-magic-1.jpg The “Gallery Magic” popup box will appear. Enter the URL of the HTML page which does contain a gallery you want to copy, then click the “Insert Gallery Magic Shortcode” button. http://www.cyberseo.net/image/img/gallery-magic-2.jpg Now simple save or update the post and Vualá, your gallery is here: http://www.cyberseo.net/image/img/gallery-magic-4.jpg Bunch Import Mode This mode is very useful for importing a bunch of galleries from a plain text dump (e.g. CSV). Simple copy/paste your dump, set the formatting rules, adjust the post scheduler options and click the import button. http://www.cyberseo.net/image/img/gallery-magic-5.jpg |
he wants to do it for already created ones.
|
Quote:
I forgot about this thread, my bad, but I think that hook is in media.php by default and is set to: 'order' => 'ASC', 'orderby' => 'menu_order ID', ect. |
ASC from ascending? why is it fucked up then?
|
Quote:
so abc_file, bas_file, etc, etc with 1's as well? |
Not sure about your wordpress, but my wordpress allows me to drag and drop the pics in the order i want them... also after getting gallery code [gallery 1,2,3,4,5,6,7,8,9,10] you can change to [gallery 1,4,2,3,5,7,6,8,10,9] if you want.
No? |
here's ids:
ids="14068,14067,14066,14065,14064,14063,14062,140 61,14060,14059,14058,14057,14056,14055,14054" numbers looks ok, but, here's gallery: Japanese gravure model Ayane Miura part 2/3 - Asian SexAsian Sex if you hover mouse over thumbs you will notice that photos starts from 029 and going down but last photo is 030 and it should be 1st photo in case of this gallery. this very gallery it is doesn't matter it just bumch of random photos but for some galleries it looking better if all are ascending (or descending) if gallery have continuous photos. so again: ids are ok, photos are fucked up. |
Deleted 8char
|
Quote:
|
edit 600 posts?
all id's are different? most photos are fucked up and randomly displayed - no way i would browse 600 posts and sort out it manually, checking which photo should be in different position. i need smth what would sort out real pic names and hopefully it will sort out ids in proper way. |
Quote:
i know i can manually move photos but like i've said before it's time consuming and when i have 24-30 photos it's to much work, beside i have this problem on most of the posts so it's to late and to much manual labor. |
so how do you want them sorted? by filename alphabetically? 1-name 2-name etc?
|
yes Fris alphabetically would be best. my filenames are usually numbered correctly so it should work yet final results in wordpress are always mess ffs..
|
Quote:
into the gallery shortcode Code:
[gallery orderby="title" ids="291,102,31"] |
fuck me Fris you're WP God :pimp
thank you very much, WORKS! now tell me how to add this line to all posts (if you know). |
Quote:
Code:
add_filter( 'shortcode_atts_gallery', 'gallery_sort_title'); |
Quote:
For example, a Maki Hojo post I checked has what looks like 3 different girls. 2 are not even close. Need a better cataloging method for the scrapes or whatever. If that is already in place then your source has misidentified them. |
Thank you Fris i owe you a promised link ;)
Thank you all guys for trying, you were great! |
Quote:
for av idols/gravure idols i'm using mostly very old content from scanners groups they rarely made mistakes with models i think, those guys were real fans. as for tsunami-cash sites i'm using provided names. but mistakes could happen ofc. |
All times are GMT -7. The time now is 12:20 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123