Hi guys,
I have some code in a PHP plugin file below:
document.getElementById('game-login-form').addEventListener('submit', function(event) {
event.preventDefault();
let username = document.getElementById('game-username').value;
fetch(`resource`)
.then(response => response.blob())
.then(blob => {
let avatarURL = URL.createObjectURL(blob);
document.getElementById('avatar-container').innerHTML = `<img src="${avatarURL}" alt="Avatar"><p>Hello, ${username}</p>`;
But once it runs on my website, WordPress adds paragraph tags everywhere, messing up the code. I’ve tried installing different plugins like rawHTML and using this code snippet to fix it:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
But sadly to no avail. Maybe I’m putting it in the wrong place, but I’ve only put it in my theme’s functions.php file as recommended. Any help is greatly appreciated!