|
WordPress kategorisinde açılmış olan Wordpress Plugin dışı kodlar konusu , ...
| LinkBack | Seçenekler | Arama | Stil |
17.04.2014, 06:12 | #1 (permalink) |
Root Administrator | Wordpress Plugin dışı kodlar Wordpress Plugin dışı kodlar 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 Wordpress Kategorileri Sidebarda Göstermek Kod: <?php wp_list_cats(); ?> Bu kodu Sidebar a <ul> Tagları arasına Eklemelisiniz</ul> Yani Kod: <ul><?php wp_list_cats(); ?></ul> <?php the_content ile başlayan kodundan Sonra Eklemenizi Tavsiye Ederim Yazının Hemen Altından Benzer Yazıları Gösterir Kod: <?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 rel="nofollow" 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); ?> |
Yukarı'daki Konuyu Aşağıdaki Sosyal Ağlarda Paylaşabilirsiniz. |
| |
Forum hakkında | Kullanılan sistem hakkında |
| SEO by vBSEO 3.6.0 PL2 ©2011, Crawlability, Inc. |