Sebentar! Apa perlu menampilkan hari dan tanggal di blog? Bukankah user atau pengunjung blog tidak memerlukannya karena sudah ada di komputer masing-masing?
Oke deh, jika merasa perlu, seperti CB lakukan di blog ini dan di New Fastest Magz, ini dia cara menampilkan hari dan tanggal di blog. Ada tiga cara:
Cara #1 Menampilkan Hari dan Tanggal di Blog
1. Dashboard > Layout
2. Page Element
3. Klik salah satu Gadget
4. Pilih HTML/Javasript
5. Masukkan kode berikut ini:
<script type="text/javascript">
now = new Date();
if (now.getTimezoneOffset() == 0) (a=now.getTime() + (7*60*60*1000))
else (a=now.getTime());
now.setTime(a);
var tahun=now.getFullYear()
var hari=now.getDay()
var bulan=now.getMonth()
var tanggal=now.getDate()
var hariarray=new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jum'at","Sabtu")
var bulanarray=new Array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember")
document.write(hariarray[hari]+" "+tanggal+" "+bulanarray[bulan]+" "+tahun)
</script>
now = new Date();
if (now.getTimezoneOffset() == 0) (a=now.getTime() + (7*60*60*1000))
else (a=now.getTime());
now.setTime(a);
var tahun=now.getFullYear()
var hari=now.getDay()
var bulan=now.getMonth()
var tanggal=now.getDate()
var hariarray=new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jum'at","Sabtu")
var bulanarray=new Array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember")
document.write(hariarray[hari]+" "+tanggal+" "+bulanarray[bulan]+" "+tahun)
</script>
6. Save!
Cara #2 Menampilkan Hari dan Tanggal di Blog
Cara ini dilakukan CB di blog ini (Template Johny Wuss).
- Template > Edit HTML
- Masukkan kode tersebut di bawah kode <div id='wrap2'> atau di atas kode <div id='header-wrapper'>
- Save!
Cara #3 Menampilkan Hari dan Tanggal di Blog
Cara ini yang dilakukan CB di Template New Fastest Magz. Perhatikan kode di bawah ini, khususnya yang berwarna merah.
<div id='topwrapper'>
<form action='/search' id='search-top' method='get'> <input name='q' placeholder='Search...' size='40' type='text'/><input id='search-button-top' type='submit' value='GO'/></form>
<div class='newspic'>
<span class='breakingnews'>Latest News</span>
<script type='text/javascript'>
var cssfeed=new gfeedrssticker("example1", "example1class", 5000, "_new")
cssfeed.addFeed("Feed Blog", "http://free-btemplate.blogspot.com/feeds/posts/default") //Specify "label" plus URL to RSS feed
cssfeed.displayoptions("date") //show the specified additional fields
cssfeed.setentrycontainer("span") //Wrap each entry with a DIV tag
cssfeed.filterfeed(10, "date") //Show 10 entries, sort by date
cssfeed.entries_per_page(1)
cssfeed.init()
</script>
</div>
<form action='/search' id='search-top' method='get'> <input name='q' placeholder='Search...' size='40' type='text'/><input id='search-button-top' type='submit' value='GO'/></form>
<div class='newspic'>
<span class='breakingnews'>Latest News</span>
<script type='text/javascript'>
var cssfeed=new gfeedrssticker("example1", "example1class", 5000, "_new")
cssfeed.addFeed("Feed Blog", "http://free-btemplate.blogspot.com/feeds/posts/default") //Specify "label" plus URL to RSS feed
cssfeed.displayoptions("date") //show the specified additional fields
cssfeed.setentrycontainer("span") //Wrap each entry with a DIV tag
cssfeed.filterfeed(10, "date") //Show 10 entries, sort by date
cssfeed.entries_per_page(1)
cssfeed.init()
</script>
</div>
Semua kode yang berwarna biru di atas dihapus semuanya, sehingga menjadi begini:
<div id='topwrapper'>
<div class='newspic'>
</div>
Nah, kode hari dan tanggal di atas lalu masukkan setelah kode <div class='newspic'>, menjadi sebagai berikut:
<div id='topwrapper'>
<div class='newspic'>
<script type="text/javascript">
now = new Date();
if (now.getTimezoneOffset() == 0) (a=now.getTime() + (7*60*60*1000))
else (a=now.getTime());
now.setTime(a);
var tahun=now.getFullYear()
var hari=now.getDay()
var bulan=now.getMonth()
var tanggal=now.getDate()
var hariarray=new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jum'at","Sabtu")
var bulanarray=new Array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember")
document.write(hariarray[hari]+" "+tanggal+" "+bulanarray[bulan]+" "+tahun)
</script>
</div>
<div class='newspic'>
<script type="text/javascript">
now = new Date();
if (now.getTimezoneOffset() == 0) (a=now.getTime() + (7*60*60*1000))
else (a=now.getTime());
now.setTime(a);
var tahun=now.getFullYear()
var hari=now.getDay()
var bulan=now.getMonth()
var tanggal=now.getDate()
var hariarray=new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jum'at","Sabtu")
var bulanarray=new Array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember")
document.write(hariarray[hari]+" "+tanggal+" "+bulanarray[bulan]+" "+tahun)
</script>
</div>
Anda bisa meniru langkah di atas untuk blog Anda. Intinya, kode yang berwarna biru itulah untuk memasang atau menampilkan hari dan tanggal di blog Anda, misalnya di atas nama/logo blog atau di navigasi Good Luck!
0 komentar:
Posting Komentar