Play music only on home page?

6 replies
  • WEB DESIGN
  • |
Hi guys

Wondering if anyone has done this. I have a client who wants one piece of music to play but only on the home page not on all the other pages, it's an mp3 file and I have got a good plugin that allows me to post the music in the sidebar or in a post/page but have not been able to find a way to have it just on the home page.

I am thinking perhaps I put something in the home.php. Does anyone know what code would make that happen and where to put it?

Thanks for any help
Sue
#home #music #page #play
  • Profile picture of the author bjradioguy
    Hi Susanne,

    I assume you mean you are using Wordpress since you talk about post/page, sidebar, and home.php.

    There are a couple of way you can do this. One, as you state, is putting the player/code somewhere on the home page so that it is only loaded when someone goes there.

    The second is a bit more complicated, but if you enjoy the player in the sidebar, but only want it on the homepage, you can create a sidebar for specifically for the home.php file and leave it off the regular sidebar that is displayed on all of the other pages.

    Just rename the homepage sidebar to something like sidebarhome.php and replace <?php include(TEMPLATEPATH."/sidebar.php");?> in your home.php file to <?php include(TEMPLATEPATH."/sidebarhome.php");?>

    Enjoy
    Signature

    Learn to Make Money Online for FREE (no gimmicks/no upsells) | Try Niche Finder - Its Free

    {{ DiscussionBoard.errors[1254500].message }}
    • Profile picture of the author Susan Hope
      Originally Posted by bjradioguy View Post

      Hi Susanne,

      I assume you mean you are using Wordpress since you talk about post/page, sidebar, and home.php.

      There are a couple of way you can do this. One, as you state, is putting the player/code somewhere on the home page so that it is only loaded when someone goes there.
      Thanks Barry!

      Yes I am using Wordpress sorry I forgot to mention that in my original post.

      I would like to do the first method, putting code into the existing home.php because I don't want to mess with the theme too much by creating other files and you mention it can be done that way but what I need to know is where would the code go and what would the code be? I don't want to put the plugin into the home.php just make it so that one piece of music plays when someone lands on the home page and not on any other page in the site.

      Got any ideas of what code to use and where to put it in the home.php?

      Cheers and thanks for your help.

      Sue
      Signature
      One-to-One WordPress Coaching Service Available at Low Hourly Rate - Let the frustration end now! WordPress Installs, Theme Design, Site Tweaks & other WordPress services available
      Find me on Pinterest: PINTEREST
      {{ DiscussionBoard.errors[1255029].message }}
  • Profile picture of the author mywebwork
    Hi Sue

    The basic HTML for embedding an MP3 file on your page is as follows:

    Code:
    <EMBED src="file.mp3" autostart=true hidden=true>
    This will play the MP3 when the page is loaded, however the user will have no control over the file.

    If you want to embed an MP3 player on your Home Page there are several ways of doing that - this article illustrates 3 common methods:

    How to Embed MP3 Audio Files In Web Pages With Google or Yahoo! Flash Player

    Bill
    {{ DiscussionBoard.errors[1255076].message }}
  • Profile picture of the author vagabondette
    please, please, please try to talk him out of this. I have yet to meet anyone who like it when music is playing on a website unless they're on a specific artist site. In fact, I'd estimate that over 80% of the people I've talked to about this have said that audio/video playing will make them immediately leave a site unless it's very obvious how to turn it off.

    So, unless your client is a musician, IMO they should really rethink this music thing because from what I've read it's one of the fastest ways to get people to leave your site.

    Just my $.02.
    {{ DiscussionBoard.errors[1255162].message }}
    • Profile picture of the author Susan Hope
      Originally Posted by vagabondette View Post

      please, please, please try to talk him out of this. I have yet to meet anyone who like it when music is playing on a website unless they're on a specific artist site. In fact, I'd estimate that over 80% of the people I've talked to about this have said that audio/video playing will make them immediately leave a site unless it's very obvious how to turn it off.

      So, unless your client is a musician, IMO they should really rethink this music thing because from what I've read it's one of the fastest ways to get people to leave your site.

      Just my $.02.
      Thanks very much for the advise

      Yes I am aware of this and did in fact make the suggestion but he really wants this and as this is for a "Drag Queen" (entertainer) it is kind of normal for that kind of site (did some research).. however the nice thing about the option Bill posted for me, I just finished inserting the google player option is that now the visitor has to click the play button for the music to play and all I did was add "Play me..." above it which I think is very cute and gives a nice compromise

      Thanks again though,
      Sue
      Signature
      One-to-One WordPress Coaching Service Available at Low Hourly Rate - Let the frustration end now! WordPress Installs, Theme Design, Site Tweaks & other WordPress services available
      Find me on Pinterest: PINTEREST
      {{ DiscussionBoard.errors[1255200].message }}

Trending Topics