Smush
Smush

Reputation: 89

Wordpress - Linking to images in HTML not working

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?

Upvotes: 3

Views: 332

Answers (2)

Tony Ray Tansley
Tony Ray Tansley

Reputation: 669

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

Upvotes: 1

Anand
Anand

Reputation: 546

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!!

Upvotes: 1

Related Questions