@elliot,
Not being a hardcore WP programmer I could use a pointer in the right direction. I’m trying to accomplish this on theme install. The images are in the theme directory when it’s installed, so I’m trying have the defaults set.
My goal is to check and if the images do not have a value set then install them, otherwise leave them as-is because the admin likely has set them themself.
@elliot
How would you go about getting an attachment ID?
I’m trying to set default images for the theme that show up in the options page when the theme is activated.
Will that work if the fields are option page fields?
I’m running into the same issue. I want to pre populate some default values for images in my theme when it is activated and need to set the image URL to the the path of an image in a specific folder.
Thanks for the help. I’ll try that. Is there any way to update an option field programmatically?
This is for the option pages, so not a post per se. It’s the main site logo, so I was assuming I’d need to use an update field and set the URL since it’s inside of the theme/images folder and not in the wp image gallery.
I was hoping to easily be able to just do something like update_field (logo, url, value) but no luck.
Looking for some example code on how to accomplish this.