Wordpress - Linking to images in HTML not working - html

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?

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

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

Related

Navbar links with varying directory

my directory is shaped like this
image
in order to use my navbar between different html files, I made it into a seperate html file and use a placeholder to insert it where i need it. the problem is that now the links get thrown off.
for example: when im on the index file, the link works without a problem. however, when im in the about_us file, the link throws a cannot find in directory error because it would need ../ in front of the link.
any javascript I have also does not work for the nav.html.
any suggestions? is there a way to create links and start the directory from the root?
To navigate to the correct HTML file, you have to pass the full path of the HTML file.
For eg: If your application is running in https://localhost:8080 than you have to pass the full path as below:
Home
About Us
Or if you directly opening the HTML file in your browser without any server, than pass the full path of your project folder as below:
Home
About Us
Note: Always use the file or folder name with a hyphen - or underscore _.
For eg: instead of html files rename your folder name as html_files or html-files.

Unable yo load images on Django Website...shows that the image is not found

please do check the image. it also consists of the error code and the folder where it shows that the file is not found
Make a folder named media in project folder and save your images at that and in src of write media/imagename try this

Html Image will not load under any change - Golang

I am trying to load an image locally onto my html. I first tried serving an image path through a /images/ folder, but that did not work. I then tried serving images with the whole path to the image like <img src="/Users/code/src/code/go/src/websites/website/website-Bucket.png" alt="test"> but I still had no luck. I checked my html and it has no errors. I have restarted my PC, changed the image to .jpg, and it still did not want to work. I get an error in Safari - An error occurred while trying to load the resource and the image shows as a blue box and question mark. What things would you try to troubleshoot?
Extra - I am using goLang to serve the files. I have it so a http.handleFunc() goes off and serves the images folder when it is requested. The path is showing http://localhost/images/theImage.png "the correct path" but nothing happens. So, I save the image and it shows it as a html and shows a section of the page?? Would that be a path thing?
In first instance you have to understand the path source, when you are on a HTML file, your path inside the file should be :
<img src="images/website-Bucket.png" alt="test">
that's because :
the path of your .html file can access trough files the inside path with the "/folder/file" structure route in the html file, so your structure files should be:
yourfiel.html (your file render on browser) /imagesfolder
-website-Bucket.png" (you call it on your html as
/imagesfolder/website/Bucket.png)./
you can learn more about paths here :
http://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/
Looks like it may be a file path issue.
Take a look at this page it has a good example.
https://www.w3schools.com/html/html_filepaths.asp
Also try renaming the image with a _ and not use the -.
Open Console in any browser and see if you see any errors that mention not being able to find the source path of the picture.
It should give you a hint of where your browser is trying to find that img.
All of your guy's responses were correct. I had the correct path. It was a Golang thing. I did not make a handlefunc when the server wants the /image.png. It was never serving the image, it just was doing nothing with it. Thank you for the responses.

I can't upload my background-image from my FTP to my website

I am stuck trying to set a background-image for the header on my website. Nothing loads.
My hosting has disabled linking images via an external URL, so I've put the image on Filezilla, that also doesn't work.
I have copied the image path from the FTP and pasted that in my html file which didn't work. I have also tried to copy code I found in tutorials, didn't work.
Whether it's the code or the FTP, I can't figure it out.
Let's say you make a map in your FTP account, we name this map Test for now.
You open the map Test and you upload a file index.html. You also upload an image in the map Test. So you have a map named Test, in the map 2 files, one index.html and image.jpg.
When you want to use this image in your index.html file you just write the simple code <img src="image.jpg"/>. This should upload the image. You visit by the link: www.yourhosting/ftpname/Test/index.html
EDIT:
NOTE: You should work online, not on your local host. As I can see youre already doing this by uploading on FileZilla.

After hosting application Images are not displayed,css is not applied

After i hosted my HTML5 application on Apache tomcat.My page is not showing any background image.
I have placed my project folder (MyExpert) inside root folder and inside MyExpert folder there is an image folder and a css folder .I am giving background image as
background-image:url(../images/myprofile_on.png)
in my css file but images are not coming on my pages except home page.Though application is working fine on localhost.I tried various thing but no fruitful result.
it looks like it will be a simple referencing or permissions issue here, try nivgating directly to the image in your browser and see if you can navigate to it manually so is this case given your description it would be:
http://www.yourdomain.com/MyExpert/images/myprofile_on.png
If that works then its a simple referencing issue from you css file, if it returns a forbidden access page you know its permissions, if it returns a file not found I would recommend checking the casing on your CSS url to ensure it matches the file path as if your box is linux then file paths are most likely case sensitive.