I chose the type of photo and wanted to show that part of the imege on the page vendor so that the seller can upload the photo there. Please give me the code showing the Field Type upload image on the vendor page.
The page I want to show there is plugin dokan page for adding the new product for vendor
@shahbazi It may be a language barrier thing, but your question is kind of difficult to understand what you are asking. When you say you want to show part of the image on the vendor page so that the seller can upload the image there. That doesn’t make any sense to me. What is part of the image? And how would displaying an image allow a user to upload an image?
Are you asking if you can use ACF to place an image upload button on the front end? I personally have never seen that done before, but can’t say for sure whether it’s possible or not. From what I understand, ACF itself won’t display an image upload field on the front end, only on a post edit screen, from which you can then display the image in your page template using something like:
// get image field return value from post edit screen
$image = get_field('vendor_image');
<!-- If return type is array -->
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<!-- If return type is URL -->
<img src="<?php echo $image; ?>" alt="hardcoded alt text description" />
If you’re wanting to give users the ability to upload images on the front end, you will most likely need to code this manually, using <input type=”file”> form control and then handling the storing/access of the image with php or js. Or perhaps you can find another plugin to do this for you, but I’ve never heard of ACF being used for something like that. Then again, I could be totally misunderstanding what you are asking.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Clients need flexibility. Developers need a repeatable workflow that doesn’t have a steep learning curve. See how digital marketing agency Noiza found both with Advanced Custom Fields in our latest case study.https://t.co/BxQAy6COJt