I’m working on a WordPress site that has an HTML5 video background. I’m trying to get the video to alternate between two options depending on the page - for example if I have 4 pages, pages 1,3 would show video A and 2,4 would show video B.

Whats the easiest way to do this? I’ve had a bit of a play but can’t think of a way to just use CSS and the body_class of each page, I don’t think you can change the of something in a tag with CSS. Please correct me if I’m wrong.

My php and js skills are pretty limited but I’m happy to have a bash at getting something to work if anyone can point me in the right direction.

Read more here: switch HTML5 video source based on body_class


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: