Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress - Linking to images in HTML not working

Tags:

html

wordpress

I am creating a website using Wordpress and currently trying to put social media buttons on the header using a text widget to input HTML but the images are not showing and I am wondering if it something to do with file permissions as when I started out developing the website I was trying to upload a header image and was getting the error "Unable to create directory [directory name] Is its parent directory writable by the server?" So I went into termnial and entered sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/sitename/wp-content/ which solved my upload issue.

I am developing locally and when I use an external website as the src for the image it displays the button on my website.

My images are stored in: /Applications/XAMPP/xamppfiles/htdocs/sitename/wp-content/myimages/

The website files are located in: /Applications/XAMPP/xamppfiles/htdocs/sitename/wp-content/themes/twentyfifteen-child/

Now the src link should be: src="../../myimages/instagram.png" but it is not and I have tried other variations even using the full link beginning from /Applications

So my question is whether this is indeed a file permission issue and if so what permissions should I use and how to enter it. However if it isn't related to permissions what else can I do to rectify the problem?

like image 240
Smush Avatar asked Dec 14 '25 07:12

Smush


2 Answers

either "/wp-content/myimages/img1.png" or just upload the images through the media upload in the cms, then grab the url from there. That makes it quicker also

like image 108
Tony Ray Tansley Avatar answered Dec 16 '25 23:12

Tony Ray Tansley


you will be success to get images please try this

in you text widget please try to pass the file Path like below:

<img src="http://www.sitename.com/wp-content/myimages/img1.png" />

befor this please confirm the image location to load image path to browser http://www.sitename.com/wp-content/myimages/img1.png

i am sure this will helps!!

like image 30
Anand Avatar answered Dec 16 '25 21:12

Anand



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!