Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Customizer API Custom WordPress Customizer Settings Course Review

Jennifer Simonds
Jennifer Simonds
4,560 Points

Hi Zac, If I am developing a Wordpress theme, how can I choose which HTML element will be effected by the $wp_customize

I would like to change a certain div in my HTML by a customiser in wp-admin, specifically I want to upload images to that div. How can I give a controller the connection to the specific DOM HTML div element class that I want to use?

Hi Jennifer,

Can you confirm what you're looking to do please? Do you mean you would like to upload an image to a set div area in your HTML template?

Thanks

-Rich

2 Answers

Jennifer Simonds
Jennifer Simonds
4,560 Points

Hi Rich Thanks for replying, yes thats it, that is my question, how can I program my wp theme so that the customiser area is set up to upload an image to a set div area in your HTML template? The image is a logo.

Hi Jennifer,

Very sorry for the delay, had left the tab open but not actually clicked Post answer...

Zac goes over how to add it to the front end within the Adding a Logo Uploader video at the 2:26 mark.

The Theme Customizer API documentation is very good for general documentation. In your case, from what you've mentioned, I think you would need the Core Custom Controls section.

Hope that helps in some way :)

-Rich