Title: Insert Images
Last modified: February 14, 2018

---

# Insert Images

 *  Resolved [Daniel Letschka](https://wordpress.org/support/users/dinonid/)
 * (@dinonid)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/insert-images-11/)
 * Hi,
    i am trying to create a shortcode, where one can insert an image from the
   media library:
 * <div id=”logo-sponsor”><div class=”grid-50″></div><div class=”grid-50″>{sponsor}
   </div></div>
 * It consists of an image in the firts halb of the shortcode, which works fine.
   But the {sponsor} variable does not work. It gives this shortcode:
 * [Logo+Sponsor sponsor=””]
 * I am trying to click inside the “” and insert an image from the media library,
   
   but it does not show on front end.
 * What am i doing wrong?
 * Thanks in advance,
    Daniel

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9977301)
 * Hi Daniel
 * Testing this for you now!
 * Kind regards
    David
 *  [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9977325)
 * Hi Daniel
 * Are you doing this in Visual or Text mode? Try Text, it more clearly shows you
   what you are doing. I can click inside the “”. But WordPress will add a fill 
   image tag, not just the URL. I would otherwise suggest to also add the image 
   code in the shortcode, and only add the url in the variable.
 * [https://monosnap.com/file/NdPo79lJdFMG3bZxyjxhIkq9UzZAfP.png](https://monosnap.com/file/NdPo79lJdFMG3bZxyjxhIkq9UzZAfP.png)
 * Does that help? Let me know!
 * Kind regards
    David
 *  Thread Starter [Daniel Letschka](https://wordpress.org/support/users/dinonid/)
 * (@dinonid)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9977462)
 * Hi David,
 * thanks for your answer!
 * I tried this in textmode. Something strange happened:
 * When i insert an image from the media library that has a caption, the image with
   the caption ist shown in the frontend. But in a broken way (image with cation
   tags around it)
 * Code:
 * [Logo+Sponsor sponsor=”[caption id="attachment_32490" align="alignnone" width
   ="150"] .[/caption]“]
 * If i delete the caption the code looks like this, but the image is not shown 
   in the frontend:
 * [Logo+Sponsor sponsor=”“]
 * I am aware of the solution, that i could only insert the image-link. But as it’s
   a site for a client, it would be nice if inserting an image would just work.
 * Any ideas?
 * Thanks again,
    Daniel
 *  [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9988705)
 * Hi Daniel
 * I can’t think of a good workaround at the moment.
 * Are the images always different? Dynamic? Or always the same?
 * Kind regards
    David
 *  Thread Starter [Daniel Letschka](https://wordpress.org/support/users/dinonid/)
 * (@dinonid)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9989543)
 * Hi David,
 * yes the images are always different. It’s for a client. But it seems, he has 
   to copy in the imagelink if there’s no other option.
    But that should be fine,
   too. It’s just not as comfortable.
 * Thx,
    Daniel
 *  [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9993118)
 * Hi Daniel
 * Yes, looks like that, especially if the images are always different…
 * Kind regards
    David

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Insert Images’ is closed to new replies.

 * ![](https://ps.w.org/post-snippets/assets/icon-128x128.gif?rev=2545587)
 * [Post Snippets - Custom WordPress Code Snippets Customizer](https://wordpress.org/plugins/post-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/post-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-snippets/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/insert-images-11/#post-9993118)
 * Status: resolved