How to put images in to a text widget
-
OK I know how to add an image to text widget using the following code:
<img src="https://brandedfashiondirect.org/wp-sf-sct-test-1/wp-content/uploads/2017/04/imagename.png>
But when I change the URL I would need to recode all my images which I am sure to miss some so I was wondering how can I make this a bit reliable. I have tried all the below and none work.
<img src="<?php bloginfo('template_url'); ?>/wp-content/uploads/2017/04/facebook.png" alt="Facebook">
<img src="<?php echo get_template_directory_uri();?>/wp-content/uploads/2017/04/facebook.png" alt="Facebook">
<img src="<?php home_url();?>/wp-content/uploads/2017/04/facebook.png" alt="Facebook">
<img src="<?php echo site_url();?>/wp-content/uploads/2017/04/facebook.png" alt="Facebook">
The file structure is:
https://brandedfashiondirect.org/wp-sf-sct-test-1//wp-content/uploads/2017/04/facebook.pngThank you in advance.
- The topic ‘How to put images in to a text widget’ is closed to new replies.