last day (15 days later) »
wyem
19:09
great thank you! :)
GhostToast
hi
wyem
hi
GhostToast
so tell me what we need to accomplish
wyem
I'll try to be more clear...
I creating a single page site where every post appear as a thumbnail
the point is that some post have a lot of images inside them
and I want the user to be able to load those images directly from the home page
when a thumbnail is clicked, it will be opened in fancybox, and the rest of the images are supposed to be visible when clicking the next button
from the backoffice, images are just uploaded in the post editor. So it appears as <img src> tags
Are u still following me? :)
GhostToast
hmm. so you need to do 2 things
1. read through all images embedded in the posts
2. make it so the images may be navigated freely in one rel gallery
is there text within these posts as well?
or just the images
wyem
19:15
no text at the moment, there is not supposed to be.
GhostToast
ok. and you have control over this? it is your own site? or we just trust that this is the case?
wyem
I can tell the future user not to add text in those posts. :)
I'm making the site for a friend.
GhostToast
and what if the user right clicks on thumbnail and says "open in new tab" ?
this is why i gave you the if(is_ajax()) stuff
have to have a condition for people who browse that way
anyway. in the single, when it is ajax, you could make it so each image in the main div is "display:none"
so say you wrap AJAX content in div called "ajax-gallery"
wyem
I tried with the working images, they open in a new tab.
Didn't thought of it.
But on middle mouse button or ctrl+click the fancybox opens.
GhostToast
then css say `div.ajax-gallery img { display: none; }
hmm lemme think
i actually did something like this here
genoaareachamber.com/photo-gallery
each photo-gallery is a post type
it gets featured image, then runs through ALL attachment images though. not just ones embedded
you can reorder those with media uploader. but you'd have to DELETE them if you don't want them included
wyem
19:21
the exact solution :)
GhostToast
but is a little dirty
all the images are already there. view source. they are just display none
its not ajax
more elegant solution would be for single.php to load all of the images and display none
so you only load them when time is right
otherwise == high bandwidth
make sense?
wyem
I don't really need ajax. Yeah I get it. that's what I was thinking about with my first proposition I guess?
Not bandwidth friendly, but working. :)
GhostToast
yea. but is possible to do "correctly" as well with a bit of tinkering
if you wanted
i'll give you source code one sec
wyem
ok
GhostToast
snippi.com/s/2ss1zkk
ok this needs modified cause it is post_type of 'gallery'
and is getting ALL images in post. not in "content"
all attachments
class="silent-partner" is display:none
wyem
19:26
I'm not sure to understand the difference
GhostToast
if i upload 300 images to a post
but only "place" 3 of them in the body
all 300 are considered attachments for the purpose of this loop
this doesnt examine the body (content), only the database. attachments are connected to posts
wyem
ok, so it takes all the images from the site?
GhostToast
no, from a particular post
wyem
sorry I'm a newb :)
GhostToast
everything you upload to a post is attached to that post until it is destroyed
a reference in the database
you have used media uploader right?
wyem
19:29
yep
GhostToast
it is confusing because within it you could place an image from one post into another, right?
but that image doesn't BELONG to that post. it is "attached to" the original post
go look at the media library. it will show you which images belong to which posts
and that is what my loop gets. images ATTACHED to the post(s). so, that can work. but you have to understand the difference to make it work for you
wyem
I'm going to have a haaard time :)
That's the messy part of wordpress
GhostToast
yea cause what you are talking about is you PLACE all the images inside a post
but then you would have to use preg_match or something to find them and do something with them
you have to rel="gallery_name" them somehow too
otherwise fancybox will just keep going from one post's images to the next
i took care of that in my second example code
wyem
already noticed that
wyem
19:47
I'll have to go. Is this room staying open or should I copy everything now?
GhostToast
better copy
wyem
:)
GhostToast
i believe the room only persists if one of us stays in it.
best of luck. let me know if you need further help after you try some things
wyem
Thanks a LOT, I'll try to adapt your code tomorrow. Yeah I'll let you know for sure.
Have a nice... afternoon?
GhostToast
yup. 3pm here
you too
wyem
19:54
thx again, bye!
last day (15 days later) »
all rooms
Transcript for
Jun '13
5
Jun
20
Chat with wyem and GhostToast
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2025 Stack Exchange Inc;
legal
mobile