Skip to content

Tag: javascript

WordPress posts in menu and custom classes

I’m new to WordPress and I’m trying to convert a pure HTML Theme to a WordPress theme. But I have a problem that I can’t find a solution for. In the nav menu, I can’t find a way to selectively add classes to the ul and li elements that WordPress generates as a menu. Basically, I need t…

multi buttons on one javascript function

foreach fetch songs from database each audio have button to pause and play all buttons of all songs works with first song only… when i press button of second or third song the first run … any solution ? blade.php js.file Answer With var player=document.getElementById(“player”); you sel…

Upload, resize and send images to server with javascript

After struggling with this issue for 2 days, reading a lot of material online, here I am begging for your help. I’m trying to resize some images uploaded via FileReader, resize with canvas and send to my server with php. Everything works as expected, except when I try to upload multiple files. The scrip…

Destructuring in php

Is it possible to use javascript like destructuring to create an associative array from variables with variable names as keys in PHP… in javascript I can do Currently I am stick to repetitive way Can anyone help, it will save me a whole lot of typing? Answer There’s no need to create your own func…