Support

Account

Home Forums ACF PRO Create a widget with ACF Reply To: Create a widget with ACF

  • Hi

    I am a little lost on this, even with the linked page above.

    I too have created a custom widget within my theme which uploads an image to echo out onto the sidebar.

    I’m not sure how to check if the image has been uploaded and then if so, display the image. Do I need to add the code(and change it to suit) in my functions.php file?

    I added the following to my widget class:

    if ( get_field('upload_image', 'widget_' . $widget_id); ) {
       echo 'IMAGE!!';
    }

    Thanks in advance