Costumize the Sidebar of WordPress 2.6.1

I used wordpress 2.6.1 to created an english blog called: Learning Diary some days ago. Because I don’t know how to add my own modules between Widgets in sidebar, so costumized the sidebar with wordpress functions, see also: WordPress Template Tags. Share my method below:

1、The recent top 10 posts:

<ul>
<?php
$postslist = get_posts('numberposts=10&order=DESC&orderby=date');
foreach ($postslist as $post) :
setup_postdata($post);
?>
<li>
<a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>

2、Recent comments:
I used a plugin: Get Recent Comments. You can config it with the page “Recent Comments” in the page “Settings”. Below is the code to call on sidebar:

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

3、Delicious:
That is a “Link Roll” in the setting page of Delicious. There is a tip, if you want to control the style of the title of delicious module, add a property in the sidebar part of global style.css like beow:

#sidebar .delicious-banner a { font: bold 12px Tahoma, Verdana, serif; color: #444; text-shadow: 1px 1px 1px #fff; }

4、Category:

<ul>
<?php wp_list_categories('orderby=name&show_count=0&title_li='); ?>
</ul>

5、Most Popular Tags:

<ul>
<?php wp_tag_cloud('smallest=8&largest=22&number=10&format=list&orderby=count&order=DESC'); ?>
</ul>

6、Archives:

<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>

7、Blogroll

<ul>
<?php wp_list_bookmarks('title_li=&categorize=0'); ?>
</ul>

If there is a way to add my own modules between those dynamic Widgets? so, I have no need to modify code in sidebar myself.

1 Comment

ламинатSeptember 5th, 2008 at 6:43 pm

3dI get a lot of interesting ideas from you post- Thanks!.1y I compleatly disagree with last post . cub
I’ll happy if you come here класс ламината 1z

蜀ICP备2021012931号-1 川公网安备51092202000377号