WordPress’te eklenti kullanmadan sidebar’da gösterebileceğimiz bu özelliklerini kodlarını paylaştık. Bir çoğu işinize yarayabilir. Biliyoruz ki eklenti kullandıkça siteyi yavaşlatabiliyor, sevmiyorlar birbirlerini bazı eklentiler birbirleri ile çalışmak istemiyorlar. (: Bu durumlar da bu kodları kullanıyoruz.
Ne dert, ne tasa.
Son Eklenen Konular
[php]<?php wp_get_archives(‘type=postbypost&limit=15′); ?>[/php]
Kategoriler
[php]<?php wp_list_cats(); ?>[/php]
Yorumlar
[php]<?php
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
comment_post_ID, comment_author, comment_date_gmt, comment_approved,
comment_type,comment_author_url,
SUBSTRING(comment_content,1,30) AS com_excerpt
FROM $wpdb->comments
LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
$wpdb->posts.ID)
WHERE comment_approved = ’1′ AND comment_type = ” AND
post_password = ”
ORDER BY comment_date_gmt DESC
LIMIT 10";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
$output .= "n<ul>";
foreach ($comments as $comment) {
$output .= "n<li>".strip_tags($comment->comment_author)
.":" . "<a href="" . get_permalink($comment->ID) .
"#comment-" . $comment->comment_ID . "" title="on " .
$comment->post_title . "">" . strip_tags($comment->com_excerpt)
."</a></li>";
}
$output .= "n</ul>";
$output .= $post_HTML;
echo $output;?>[/php]
Etiketler (Tag Cloud)
[php]<?php wp_tag_cloud(‘smallest=8&largest=20′); ?>[/php]
Bağlantılar
[php]<?php get_links_list(); ?>[/php]
Aylık Arşiv
[php]<?php wp_get_archives(‘type=monthly’); ?>[/php]
Yıllık Arşiv
[php]<?php wp_get_archives(‘type=yearly’); ?>[/php]
Sayfalar
[php]<?php wp_list_pages(‘title_li=<h2>Son Sayfalar</h2>’); ?>[/php]
Değişen Etiket Bulutu
[php]<?php wp_tag_cloud(‘smallest=11&largest=25&unit=px&number=50&format=flat&orderby=count&order=RAND’); ?>[/php]
Benzer Yazılar
[php]<?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);
?>[/php]
http://www.r10.net/wordpress/273579-plugin-disi-kodlar-hepsini-toplayalim.html
Leave a comment