mardi 12 janvier 2016

How to get uploaded image location url by cmb2

I made a image add file field in by cmb2 metabox like

$FF_side_settings->add_field( array(
        'name'    => 'Upload background image',
        'desc'    => 'Upload an image or enter an URL.',
        'id'      => 'ff_image_upload',
        'type'    => 'file',
        // Optional:
        'options' => array(
            'url' => true, 
            'add_upload_file_text' => 'Add image' 
        ),
    ) );

I want to get the image location and show the value in my div image background-url

<div class="fun-bg " style='background-image: url("'.$image.'");'>

I used wp_get_attachment_image( get_post_meta( get_the_ID(), 'gsff_image_upload', 1 ), 'medium' ); for that but i faild to do that. can someone please help me to find out where is my problem please and fix that............



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire