Wordpress kullanan ve bilmeyen arkadaşlarımız olabileceği düşüncesiyle 3 önemli özelliği sizinle paylaşmak istedim.

Alıntı
Wordpress neredeyse dünyanın en iyi içerik yönetim sistemi ve wordpress için bir çok tema ve eklentiyi internetten bulmanız mümkün. Peki kodlama bilmeden hazır şablonlar herşey için yeterli mi? Evet yeterli aslında ama bunu mükemmeleştirmekde sizin elinizde. İşte sizler için derledigimiz 3 hile ;
1- 1 aydan eski yazılarda yorum eklemeyi iptal etme
Aşağıdaki kodları temanızın function.php dosyasına yerleştiriniz.
2- Sitenizin altındaki copyright yılını otomatik değiştirme
Aşagıdaki kodu footer.php ye yerleştiriniz
3- Blogunuzdaki toplam yazı sayısını göstermek
Aşagıdaki kodu gerekli gördügünüz yere ekleyeilirsiniz.
1- 1 aydan eski yazılarda yorum eklemeyi iptal etme
Aşağıdaki kodları temanızın function.php dosyasına yerleştiriniz.
Alıntı
<?php
function close_comments( $posts ) {
if ( !is_single() ) { return $posts; }
if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( 30 * 24 * 60 * 60 ) ) {
$posts[0]->comment_status = ‘closed’;
$posts[0]->ping_status = ‘closed’;
}
return $posts;
}
add_filter( ‘the_posts’, ‘close_comments’ );
?>
function close_comments( $posts ) {
if ( !is_single() ) { return $posts; }
if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( 30 * 24 * 60 * 60 ) ) {
$posts[0]->comment_status = ‘closed’;
$posts[0]->ping_status = ‘closed’;
}
return $posts;
}
add_filter( ‘the_posts’, ‘close_comments’ );
?>
Aşagıdaki kodu footer.php ye yerleştiriniz
Alıntı
Copyright © 200x-<?php echo date('Y'); ?> PcProgrami.com.(Burası Örnek Kendi Sitenizi Yazmalisiniz )
Aşagıdaki kodu gerekli gördügünüz yere ekleyeilirsiniz.
Alıntı
<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'");
if (0 < $numposts)
$numposts = number_format($numposts);
echo $numposts.’ posts.’;
?>
if (0 < $numposts)
$numposts = number_format($numposts);
echo $numposts.’ posts.’;
?>
