Question:
Why won’t my custom code display where I choose from the dropdown menu?
Product:
Wix Website Editor
What are you trying to achieve:
I added some custom code – a pre-formatted javascript snippet produced by Entrythingy.com to display entries in a juried art show – and if I say put it at the start of the body, it appears above the header; if I say put it at the end of the body, it appears below the footer. How can I get it to land in between?
What have you already tried:
I also tried embedding the code, which caused an error (because it isn’t just HTML?). I have tried various location selections from the dropdown, but cannot get it to display within the body of the page.
Add one of the mentioned elements onto your page.
If you choose the HTML-Component (iFrame) → you can put the HTML-CODE into the HTML-Comp and save it.
And maybe it would also help to show the code you want to implement.
you’re having trouble getting your custom code to display in the desired location within your Wix website. Here are a few steps you can take to resolve this issue:
Steps to Fix the Issue
Use an HTML iFrame:
Since your code isn’t just HTML, embedding it directly might cause issues. Instead, try using an HTML iFrame to embed the code within the body of your page. This can help isolate the code and ensure it displays correctly.
To add an iFrame, go to Add > Embed > Embed a Widget and paste your code inside the iFrame.
Custom Code Placement:
Ensure that you are placing the custom code in the correct section of your page. In Wix, you can add custom code to the head, start of the body, or end of the body. However, for more precise placement, using an iFrame or a custom HTML element within the page content might be necessary.
Check for Errors:
Make sure there are no syntax errors in your JavaScript code. Even a small error can prevent the code from running correctly.
Use Velo by Wix:
For more advanced customizations, consider using Velo by Wix (formerly Corvid). Velo allows you to add custom code directly to your site and provides more control over where and how the code is executed.
You can access Velo by going to Dev Mode > Turn on Dev Mode in the Wix Editor.
Example of Using an iFrame
Here’s an example of how you can use an iFrame to embed your custom code:
< iframe src=“https://www.entrythingy.com/your-code-url” width=“100%” height=“500px” style=“border:none;”>
Thank you – I’ll share the code snippet next chance I get (it’s a gallery widget from Entrythingy.com, and I don’t have it saved where I can get to it for a few hours), but I can tell you that when I tried using the embedded frame before, it gave an error message when the page loaded and the frame displayed as if it was trying to load content but without ever fully loading.
The gallery is currently displayed on the page below the footer.