Options

Music only on homepage

dschleif1dschleif1 Registered Users Posts: 5 Beginner grinner
edited July 18, 2014 in SmugMug Customization
Hello! I was wondering if someone could help me out with my code to only allow music to be played on my homepage. I'm not very savvy when it comes to website design and code, but I do what I can with research. I added music to my website using this code in my footer:

<div id ="my_music"><audio controls autoplay="controls"><source src="http://free.mp3songurls.com/1374387.mp3&quot; autoload="true" autoplay="true" hidden="true" type="audio/mp3" /></source></audio> </div>

I then added this code to my CSS box, which I read would only allow music to be played on my homepage, but it hasn't worked:

#my_music {display: none;}
.homepage #my_music {display: block;}

I'm pretty much stuck on this one. Thanks a TON!!!!

Comments

  • Options
    AllenAllen Registered Users Posts: 10,011 Major grins
    edited July 18, 2014
    It would go into an html block but I don't think this type html is allowed by Smug.

    BTW, you close the <source> with a / (...udio/mp3" /></source>) so the </source> is not needed.
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    thenickdudethenickdude Registered Users Posts: 1,302 Major grins
    edited July 18, 2014
    Unfortunately, SmugMug doesn't currently allow either of or tags in HTML blocks. If you wanted to play music, the only way I can think of doing that is by uploading it as a video to your SmugMug gallery, then add it to the page using the Video content block and set it to autoplay. You could then make that block invisible with CSS. You could make it play only on the homepage by adding it to the body of your homepage in the customiser, instead of putting it in your sitewide footer.
Sign In or Register to comment.