• Resolved polys_a

    (@polys_a)


    Hello

    I am working with an upload custom field. When trying to display the image in front we get the image id and not the source url.

    Here is the code:

    ” />

    The documentation suggest this code.

    any help pls?

    regards.
    P

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    I can’t see the code.

    Please use the code tags that you have in the editor like this.

    Best regards,

    Thread Starter polys_a

    (@polys_a)

    Hey
    Here you go:

    <img src="<?php the_cfc_field('companyinfo', 'luxury-logo'); ?>" />

    Hey there,

    First of all, I have found a mistake in the documentation and have corrected it. The first parameter is the name of the meta box, not the name of the meta field, as it said before.

    But have you probably figured it out yourself, since you are getting some output.

    I don’t know why you’re getting the ID instead of the URL, I have tried to reproduce the problem, but I could not. Here it returns the URL.

    Anyway, you can correct this by wp_get_attachment_url function that returns the URL based on ID.

    Pay attention to the fact that, in order to pass the value on to a function, you’ll have to turn echo to FALSE. This is the 5th parameter in our function.

    With the best of wishes,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image URL in Fontend’ is closed to new replies.