Wordpress Plugin dışı kodlar

  • Konbuyu başlatan Konbuyu başlatan Z1rT
  • Başlangıç tarihi Başlangıç tarihi
9
EXE RANK

Z1rT

Fexe Kullanıcısı
Puanları 0
Çözümler 0
Katılım
26 Kas 2009
Mesajlar
9,190
Tepkime puanı
0
Puanları
0
Yaş
33
Web sitesi
www.netbilgini.net
Z1rT
Tema Yapan Arkadaşlar Ve Tema Edit Yapacak Arkadaşlar İçin Yarayışlı oldugunu Düşnüüyorum Şahsen Kendim Tema Yaparken Hep kopylaarım 0 dan yazmaya üşeniyorum
smile.gif

Hergün Güncel olarak Yazacagım

codex.wordpress.org dan Türkçe olarak İçerikleri Dökmeye çalısacagım.

Wordpress Kategorileri Sidebarda Göstermek

PHP- Kodu:

<?php wp_list_cats(); ?>

Bu kodu Sidebar a <ul> Tagları arasına Eklemelisiniz</ul>
Yani
PHP- Kodu:

<ul><?php wp_list_cats(); ?></ul>

Konu içinde Benzer Yazıları Göstermek

<?php the_content ile başlayan kodundan Sonra Eklemenizi Tavsiye Ederim Yazının Hemen Altından Benzer Yazıları Gösterir
PHP- Kodu:

<?php
$this_post
= $post;
$category = get_the_category(); $category = $category[0]; $category = $category->cat_ID;
$posts = get_posts('numberposts=4&offset=0&orderby=post_date&order=DESC&category='.$category);
$count = 0;
foreach (
$posts as $post ) {
if (
$post->ID == $this_post->ID || $count == 5) {
unset(
$posts[$count]);
}else{
$count ++;
}
}
?>
<?php if ( $posts ) : ?>
<ul>
<?php function getWords($text, $limit) {
$array = explode(" ", $text, $limit +1);
if(
count($array) > $limit) {
unset(
$array[$limit]);
}
return
implode(" ", $array); }
?>
<?php foreach ( $posts as $post ) : ?>
<?php $mycontent = strip_tags($post->post_content);
$excerpt = getWords($mycontent, 15);
$a_title = $excerpt . "..."; ?>
<li><a href="<?php the_permalink(); ?>" title="<?php echo $a_title ?>">
<?php if ( get_the_title() ) { the_title(); } else { echo "Untitle"; } ?></a>
<?php endforeach // $posts as $post ?>
</ul>
<?php endif // $posts ?>
<?php
$post
= $this_post;
unset(
$this_post);
?>

 
Geri
Üst