CARI Infonet

 Forgot password?
 Register

ADVERTISEMENT

View: 2505|Reply: 5

Cara Membuang Waktu di Wordpress

[Copy link]
Post time 8-7-2013 07:48 PM | Show all posts |Read mode
Jika anda menggunakan Wordpress sebagai medium untuk membuat website, anda akan perasan terdapat waktu post anda dimuat naik bukan? Baiklah jika anda mahu website anda kelihatan professional, and mungkin mahu membuat waktu post anda itu. Bagaimana untuk membuangnya? Jangan risau saya akan mengajar anda cara mudah ;)

1. Manual Method
Cara yang 'elok' untuk anda membuang waktu ialah mengubahsuai tema Wordpress anda dengan menukar kod waktu yang menunjukkan waktu post.
  • Backup tema anda, just in case
  • Pergi ke “Appearance > Editor” dan ulangi langkah-langkah berikut bagi setiap fail PHP anda.
  • Cari function calls berikut di dalam tema kod anda: the_date(), echo get_the_date(),the_modified_date(), and the_time()
  • Selubungi function calls dengan PHP comment markers (/* and */); sebagai contoh:

<?php /*the_date();*/ ?><?php /*the_date('F j, Y');*/ ?><?php /*echo get_the_date();*/ ?><?php /*the_modified_date();*/ ?><?php /*the_modified_date('', 'Last modified ');*/ ?><?php /*the_time( get_option('date_format') );*/ ?>
Kamu mungkin mahu membuang text lain yang menyelubungi function call. Sebagai contoh, jika tema anda anda kod seperti berikut…

<div>  Published on <?php the_time( get_option('date_format') ); ?></div>
…tukarkan dengan kod ini…
<div>  Published on <?php /*the_time( get_option('date_format') );*/ ?></div>…tema anda akan mengeluarkan output “  Published on,” tetapi bukan waktunya. Dengan membuang “  Published on” dari tema fail anda akan membuang output "  Published on" itu daripada lawan web anda. Kamu harus membuang "  Published on" itu supaya laman web anda kelihatan 'bersih'.

Tekan “Update File”

2. Automatic Method
Jika anda mahu cara pantas, pergi ke “Appearance > Editor” di dalam admin Wordpress anda dan tambah kod ini didalam "theme’s functions.php file". Letak di atas sekali tetapi selepas pembuka barisan <?php.
function jl_remove_post_dates() {        add_filter('the_date', '__return_false');        add_filter('the_time', '__return_false');        add_filter('the_modified_date', '__return_false');} add_action('loop_start', 'jl_remove_post_dates');
(Nota: Cara ini memerlukan WordPress 3.0 atau ke atas)
Sekarang cuba check website anda jika waktu itu sudah hilang. Jika belum, cuba menukar dengan meggunakan kod yang lebih “aggressive”:
function jl_remove_post_dates() {        add_filter('the_date', '__return_false');        add_filter('the_time', '__return_false');        add_filter('the_modified_date', '__return_false');        add_filter('get_the_date', '__return_false');        add_filter('get_the_time', '__return_false');        add_filter('get_the_modified_date', '__return_false');} add_action('loop_start', 'jl_remove_post_dates');

Harap dapat membantu, cara ini sangat berkesan kerana saya sendiri menggunakannya

Admin,
www.caramembuatwww.com Last edited by trunks on 9-7-2013 12:33 AM

Reply

Use magic Report


ADVERTISEMENT


Post time 9-7-2013 12:26 AM | Show all posts
bawak-bawaklah guna [ code ][ / code] macam ni dik oi

pening tengok coding dengan emoticon ketawa bagai


  1. function jl_remove_post_dates() {
  2.     add_filter('the_date', '__return_false');
  3.     add_filter('the_time', '__return_false');
  4.     add_filter('the_modified_date', '__return_false');
  5.     add_filter('get_the_date', '__return_false');
  6.     add_filter('get_the_time', '__return_false');
  7.     add_filter('get_the_modified_date', '__return_false');
  8. }
  9. add_action('loop_start', 'jl_remove_post_dates');

Copy the Code

Rate

1

View Rating Log

Reply

Use magic Report

Post time 9-7-2013 12:28 AM | Show all posts
baidewei, bila buang waktu, orang tak tahu tu post zaman Nabi mana, entah berita baharu, entah berita lama, tak elok posting benda tak ada tarikh. susah orang nak beza
Reply

Use magic Report

Post time 9-7-2013 12:34 AM | Show all posts
<div>  Published  akan keluar emoticon gelak

tak apa edited..
Reply

Use magic Report

Post time 9-7-2013 12:24 PM | Show all posts
atau cuba ikut video dr utube ni

  
Last edited by trunks on 9-7-2013 04:51 PM

Reply

Use magic Report

 Author| Post time 9-7-2013 02:40 PM | Show all posts
kakikuDibibirmu posted on 9-7-2013 12:26 AM
bawak-bawaklah guna [ code ][ / code] macam ni dik oi

pening tengok coding dengan emoticon ketawa ...

Thanks betulkan
Reply

Use magic Report

Follow Us
You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CARI Infonet

29-3-2024 02:57 PM GMT+8 , Processed in 0.516687 second(s), 37 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list