How to Add Music MP3 Playlist in Blogger

Download 4

Installing Music Player in Blogger
The first thing you should do is to Login into your Blogger Dashboard through your Google account. After logging into your account, from the list of your blogs, select that blog on which you want to install HTML5 Music Player. Now go to Template >> Edit HTML and search for the ending Tag. After finding the tag, just above it paste the following code.

  • <link href='http://fonts.googleapis.com/css?family=Open+Sans:400' rel='stylesheet' type='text/css'/>
    
    <link href="https://googledrive.com/host/0B0WJjcJEFNziLXFVNjE1Mms2VkU" rel="stylesheet"></link>
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    
    <script src="https://googledrive.com/host/0B0WJjcJEFNziYXRYUFZEVkRNaTA" type="text/javascript"></script>

Once the whole thing is done, it is the period to save your template. Just press the “Save Template” button situated on the top right corner of your monitor screen. Now move to the next step ahead.

Adding Music Player in Blogger
The next thing is to add the HTML5 music player either in your sidebar or into specific page/posts on your site. This entirely depends on your needs, whether you want it into your sidebar, posts, pages or anywhere else. It would work perfectly well everywhere. Follow the following instructions properly.

Go to Blogger >> Layout >> Add a Gadget >> Add HTML/JavaScript and just paste the following code into the HTML Text Box. Now you probably want to customize your Music player so before we save the gadget lets learn how you can customize it. For example, Changing, Music, Covers and etc.

  • <div class="mbl">
     <div class="mbl_player" id="mnplp">
      <div class="mbl_art_bg"></div>
      <img class="mbl_cover" src="" alt=""/>
      <span class="mnpl_title"></span>
      <span class="mnpl_author"></span>
      
      <div class="mnpl_volume_min"></div>
      <div class="mnpl_volume"></div>
      <div class="mbl_volume_max"></div>
      
      <div class="mnpl_toolbar">
       <div class="mnpl_tlb_prev"></div>
       <div class="mnpl_tlb_stop"></div>
       <div class="mnpl_tlb_next"></div>
       <div class="mnpl_current"></div>
       <div class="mnpl_long"></div>
       <div class="mnpl_all"></div>
      </div>
      
      <div class="mbl_playlist">
      </div>
     </div>
     </div>
    
    <script type="text/javascript">
    $(function(){
    $('#mnplp').mnplp({
    'volume': 80,
    'playlist':[
    {"title":"Track-Name", "author":"Author-Name", "cover":"thumb-image.jpg", "background":"cover-image.jpg", "mfile":"music.mp3"},
    
    {"title":"Track-Name", "author":"Author-Name", "cover":"thumb-image.jpg", "background":"cover-image.jpg", "mfile":"music.mp3"},
    
    {"title":"Track-Name", "author":"Author-Name", "cover":"thumb-image.jpg", "background":"cover-image.jpg", "mfile":"music.mp3"},
    
    {"title":"Track-Name", "author":"Author-Name", "cover":"thumb-image.jpg", "background":"cover-image.jpg", "mfile":"music.mp3"},
    
    {"title":"Track-Name", "author":"Author-Name", "cover":"thumb-image.jpg", "background":"cover-image.jpg", "mfile":"music.mp3"}
        ]
       });
      });
     </script><style> .mbl_player { width: 500px;} .mbl { float: left; width: 520px; border-top: 1px solid #d2d2d2; margin-bottom: 0px; padding: 0px; } .mbl_player .mnpl_current { padding: 2px!important; padding-left: 10px!important; } .mbl_player .mnpl_all, t { padding: 2px; }</style>

Customization
title : Represents the title of your music or song.
mfile : It represents the music file in .mp3 extension
author : The name of the person who composed the music.
cover : Cover thumb image that appears when the song is playing.
background : The image that appears in the background of the music player.

After customizing, press "Save" button located at the bottom of the window. Now, go and check your site. I am pretty sure your site would rock now. Let us know about your thoughts on this amazing gadget.

Live Demo MP3 Playlist


ดูวิธีใส่เครื่องเล่น MP3 แบบ Playlist ลงใน Blogger ภาษาไทยได้ที่นี่

How to add Random Posts with Thumbnails in Blogger

Download 0
Showing random posts out of your blog is really good to engage users more. You can show your random posts any where in the template where you think that this can prove to be eye catchy. Getting random posts in the WordPress with the power of PHP and MySQL is quite an easy job to be done but in case of blogger where you don’t have any freedom like this you need to show random posts via a trick which uses java script. Showing random posts with thumbnails is possible in the blogger. Fortunately it’s not a tough job you can just add a widget for showing random posts with thumbnails in a blogspot blog.

1.Login to your blogger account and go to the blog where you need these random posts to show up.

2.Select the blog and open layout from the left sidebar of the blogger dashboard.

3.There you need to add new widget to the sidebar which should be Html/Javascript.

4.After adding the Html/Javascript you need to grab the following code with styles attached.
  • <ul id='random-posts'>
    <script type='text/javaScript'>
    var tow_numposts=5;
    var tow_snippet_length=150;
    var tow_info='yes';
    var tow_comment='Comments';
    var tow_disable='Comments Disabled';
    var tow_current=[];var tow_total_posts=0;var tow_current=new Array(tow_numposts);function totalposts(json){tow_total_posts=json.feed.openSearch$totalResults.$t}document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&max-results=0&callback=totalposts\"><\/script>');function getvalue(){for(var i=0;i<tow_numposts;i++){var found=false;var rndValue=get_random();for(var j=0;j<tow_current.length;j++){if(tow_current[j]==rndValue){found=true;break}};if(found){i--}else{tow_current[i]=rndValue}}};function get_random(){var ranNum=1+Math.round(Math.random()*(tow_total_posts-1));return ranNum};
    </script>
    <script type='text/javaScript'>
    function random_posts(json){for(var i=0;i<tow_numposts;i++){var entry=json.feed.entry[i];var tow_posttitle=entry.title.$t;if('content'in entry){var tow_get_snippet=entry.content.$t}else{if('summary'in entry){var tow_get_snippet=entry.summary.$t}else{var tow_get_snippet="";}};tow_get_snippet=tow_get_snippet.replace(/<[^>]*>/g,"");if(tow_get_snippet.length<tow_snippet_length){var tow_snippet=tow_get_snippet}else{tow_get_snippet=tow_get_snippet.substring(0,tow_snippet_length);var space=tow_get_snippet.lastIndexOf(" ");tow_snippet=tow_get_snippet.substring(0,space)+"…";};for(var j=0;j<entry.link.length;j++){if('thr$total'in entry){var tow_commentsNum=entry.thr$total.$t+' '+tow_comment}else{tow_commentsNum=tow_disable};if(entry.link[j].rel=='alternate'){var tow_posturl=entry.link[j].href;var tow_postdate=entry.published.$t;if('media$thumbnail'in entry){var tow_thumb=entry.media$thumbnail.url}else{tow_thumb="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8hso9_Dk7DJMEFFgkLpXoB1IKh9q2mVo8RDF1YdKODqhoiATRJgZ-5TFTYRp_3LrcUXM0V8yqz-QYxVBlwBJx6UBRDXquBb93Edp_oCIUEtVYVcb21WPNMIVB2ewBv69EvDN1QeB6LK0/s1600/default.jpg"}}};document.write('<li>');document.write('<img alt="'+tow_posttitle+'" src="'+tow_thumb+'"/>');document.write('<div><a href="'+tow_posturl+'" rel="nofollow" title="'+tow_snippet+'">'+tow_posttitle+'</a></div>');if(tow_info=='yes'){document.write('<span>'+tow_postdate.substring(8,10)+'/'+tow_postdate.substring(5,7)+'/'+tow_postdate.substring(0,4)+' - '+tow_commentsNum)+'</span>'}document.write('<div style="clear:both"></div></li>')}};getvalue();for(var i=0;i<tow_numposts;i++){document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&start-index='+tow_current[i]+'&max-results=1&callback=random_posts\"><\/script>')};
    </script>
    </ul>
    <style type='text/css'>
    #random-posts img{float:left;margin-right:10px;border:1px solid #999;background:#FFF;width:100px;height:100px;padding:3px}
    #random-posts li{margin: 0px 0px 10px 0px;}
    </style>

5.Just paste this in the widget area and give widget the title of “You May Like to Read:” and click save. Re arrange the widget as per your need. If you want to increase the number of posts shown then kindly increase the number tow_numposts=5;. Simple! you are done have happy blogging
 

Premium Blogger Templates