ok so im creating a wp theme and on the homepage i have a sidebar that i want to display some images like maybe 8 or so and it’s responsive so its in 2 columns then 1 column, that sorta thing. when i built the site it was still static so i just used but now that i moved into wordpress im trying to figure out how i could upload images into the media uploader and then do some sort of function to query and array and spit the images out and be able to specify the size i want the thumbs to be, how many to spit out, that sorta thing. i know there is a way to do this but im looking and i cant find it or maybe i am seeing it but just not getting it. if somebody could help me that would be really amazing! :)
Install Advanced Custom Fields plug-in and create custom field group for your images. Set up rules to only be applicable to specific page you are targeting. Create as many fields as you need, name them appropriately, then just write a function to output them where you need them, here is sample code from my recent project, it builds a Lean Slider Markup by Gilbert Pellegrom:
// Build Lean-Slider HTML and output all custom fields
There isn’t any native WordPress function to spit out images though like loop through an array of images? Just curious? I tried to find something explaining something like that in the codex but no luck. Idk if I’m just not typing in the write thing.
Yes there is a native way and you just have to follow two steps.
1. Create an option page in admin and give the options to upload images to the admin.
2. Use the path of those images where you want to display them with the help of ‘for’ or while loop.
Now how would you do these two steps, let me suggest the best tutorial for it.