个人工具
名字空间
变换
操作

WordPress:Customizing Your Sidebar

来自站长百科
跳转到: 导航, 搜索

The sidebar, also known as the menu, is a narrow vertical column often jam-packed with lots of information about a website. Found on most WordPress sites, the sidebar is usually placed on the right or left-hand side of the web page, though in some cases, a site will feature two sidebars, one on each side of the main content where your posts are found. This tutorial examines some of the information items and features generally found in the sidebar. After reading this article you’ll feel more comfortable in adding or changing the content of your own sidebar.

边框,也称为菜单是个狭窄的竖直的栏,通常填满了许多关于网站的信息。在大多数WordPress站点上都能够发现边框,通常出现在网页的左边或者右边,但是有时候,站点上可能拥有两个边框,在文章的两边各有一个。指南检查了边框中通常出现的信息items和功能。阅读这篇文章之后,你更加善于添加或者更改自己的边框的内容。

目录

Nested Lists

嵌套的列表

The Classic and Default WordPress Themes use nested lists to present their sidebar information. Nested lists are a series of unordered lists of information, set inside of each other. Here's a simple example:

经典的和默认的WordPress主题使用嵌套的列表呈现边框中的信息。嵌套列表是信息的一系列无序列表,嵌套设置。下面有一个样本例子:

<ul><!-- open whole list -->
<li>Title of Section One
     <ul>
      <li>Apple</li>
      <li>Orange</li>
      <li>Banana</li>
     </ul>
</li><!-- closing list under section one -->
<li>Title of Section Two
     <ul>
      <li>Beef</li>
      <li>Chicken</li>
      <li>Fish</li>
     </ul>
</li><!-- closing list under section two -->
<li>Title of Section Three
     <ul>
      <li>Carrot</li>
      <li>Celery</li>
     </ul>
</li><!-- closing list under section three -->
</ul><!-- closing whole list -->




<ul><!-- open whole list -->
<li>Title of Section One
     <ul>
      <li>Apple</li>
      <li>Orange</li>
      <li>Banana</li>
     </ul>
</li><!-- closing list under section one -->
<li>Title of Section Two
     <ul>
      <li>Beef</li>
      <li>Chicken</li>
      <li>Fish</li>
     </ul>
</li><!-- closing list under section two -->
<li>Title of Section Three
     <ul>
      <li>Carrot</li>
      <li>Celery</li>
     </ul>
</li><!-- closing list under section three -->
</ul><!-- closing whole list -->








Each of these nested list "sections" can feature a CSS ID or class to make each one look different or all the same, depending upon how they are styled within the style sheet.

所有的这些嵌套列表"部分"可以拥有CSS ID 或者 class确定列表看起来不同或者全部相同,这取决于列表在样式表中的设计。

You don't have to use nested lists for your sidebar. That is up to you. If you do use the nested lists as set by example in the WordPress core Themes, you need to know how they work. To learn more about how to style your WordPress nested lists, check out the article on WordPress:Styling Lists with CSS.

你不需要为边栏使用嵌套列表。使不使用嵌套列表取决于你自己。如果你真的使用WordPress核心主题中设计的嵌套列表的例子,你需要了解这些嵌套列表是怎样运行的。学习更多的关于怎样设计WordPress嵌套列表,请查看CSS设计列表中的文章。

Navigation

导航

Historically, the main purpose of the sidebar has been to provide navigation assistance for the visitor - a function that commonly continues to the present day. These navigation aids are designed to help people move about your site and find the information you want them to see. The list of navigation items includes Categories, WordPress:Pages, Archives, and even the most recent posts. Another navigational tool you'll see in the sidebar is a search form to help people find what they are looking for on your site.

从历史记录来看,边栏的主要目的是为访客提供导航帮助-一直持续到今天的功能。设计这些导航帮助是要帮助人们在你的站点上浏览,并且找到你想要显示的信息。导航列表内容包括类别, 网页, 归档和最近的文章。你在边框中看到的另一个导航工具是搜索形式,用来帮助人们找到他们在你的站点上查找的内容。

The first information in the standard WordPress installation is a list of WordPress:Pages or Categories. Listing WordPress:Pages helps the visitor find more information about your site, like About, Contact, Register, or Site Map.

标准的WordPress安装中首次出现的信息,就是一列网页或者类别。列出网页帮助访客找到更多的关于你的站点的信息,像关于, 联系, 登录, 或者 站点 地图

The information displayed in the sidebar is controlled by your Theme's Template sidebar.php file.

边栏中显示的信息,有你的主题的 模板 sidebar.php 文件控制。

An example usage of the Pages list template tag in your sidebar.php file might be:

sidebar.php 文件中的网页列表模板标签的用法例子可能是:

<?php wp_list_pages('title_li=<h2>Pages</h2>'); ?>

<?php wp_list_pages('title_li=<h2>Pages</h2>'); ?>

This puts the title Pages in an H2 heading and then puts the Pages in a list below the title. This is just one sample of its usage and there are more options available for controlling the end result of the template tag called wp_list_pages().

这个例子使得标题网页放入了H2标题中,然后将网页放入标题下面的列表中。这只是用法的一个例子,还有更多的选项用来控制称为wp_list_pages()的模板标签的最后结果。

Listing the Categories helps the visitor find the information they want by topic. This might look like:

列出类别帮助访客找到他们想要的信息。这可能看起来像:

<li id="categories"><?php _e('Categories:'); ?>
	<ul>
<?php wp_list_cats(); ?>
	</ul>
 </li>
<li id="categories"><?php _e('Categories:'); ?>
	<ul>
<?php wp_list_cats(); ?>
	</ul>
 </li>

This lists the title Categories within the menu list, and then creates a nested list underneath to list the WordPress categories you've added to your site. If you have no posts in a category, it will not show up on the list by default. Add a post, and it will be there.

这个在菜单列表内列出了标题类别,然后在下面创建了嵌套的列表,列出了你添加到站点上的WordPress类别。如果类别中没有文章,默认情况下,就不会显示列表。添加一篇文章,列表就会显示。

The WordPress Default Theme, Kubrick, uses a set of navigation tags on its index.php template file, but you can use this same set in your sidebar to emphasize the navigation from one post to another in chronological order:

WordPress默认主题,Kubrick,在它的index.php模板文件中使用一组导航标签,但是你可以在你的边框中使用同样的导航标签,突出按时间顺序,从一篇文章导航到另一篇文章:

<div class="navigation">
<div class="alignleft">
     <?php next_posts_link('&laquo; Previous Entries') ?>
</div>
<div class="alignright">
     <?php previous_posts_link('Next Entries &raquo;') ?>
</div>
</div>



<div class="navigation">
<div class="alignleft">
     <?php next_posts_link('&laquo; Previous Entries') ?>
</div>
<div class="alignright">
     <?php previous_posts_link('Next Entries &raquo;') ?>
</div>
</div>




This example puts the text for the links to the right and left parts of the screen. You can change this to something more suitable to your sidebar's look by changing the style sheet references or by further customizing the next and previous post links.

这个例子将链接的文本放置到屏面的右边和左边的部分。通过更改样式表references或者通过自定义下一个和上一个文章链接你可以更改这种链接文本的位置,使得布局更适合你的边栏的外观。

Post Lists

文章列表

Part of helping your visitors navigate your site is to point them towards specific posts and archives. Your most recent posts and archives can be displayed in a variety of ways in your sidebar. The WordPress Classic and Default Themes showcase the archives by month:

通过向访客指向某篇文章和存档,可以帮助访客在你的站点导航。你最近的文章和归档可以在你的边栏上以不同的方式显示。WordPress经典的和默认的主题按月显示归档:

<li id="archives"><?php _e('Archives:'); ?>
     <ul>
<?php wp_get_archives('type=monthly'); ?>
     </ul>


<li id="archives"><?php _e('Archives:'); ?>
     <ul>
<?php wp_get_archives('type=monthly'); ?>
     </ul>


Using the wp_get_archives() template tag, you can customize this list in a variety of ways. Let's say you want to list the last 15 posts you've written by their title. Replace the type=monthly as follows:

使用wp_get_archives(),你可以以许多不同的方式,自定义列表。假如你想要列出你写的最近15篇文章的标题。如下,代替type=monthly

<?php wp_get_archives('type=postbypost&limit=15'); ?>
<?php wp_get_archives('type=postbypost&limit=15'); ?>

There are also WordPress:Plugins which can help you customize different ways of showcasing your lists of posts. They can be customized by category, most commented on, most recent, most recently updated, and the list goes on.

也有插件可以帮助你自定义许多不同的显示文章列表的方式。文章可以通过类别显示,评论数目的多少,或者最新发表的时间顺序,最新更新的时间次序,或者列表次序显示。

Coffee2code's Customizable Post Listings offers myriad ways of creating a customizable list of posts in your sidebar. For example, if you would like to create a list of the 5 posts that have most recently been commented on:

Coffee2code的可自定义的文章列表提供了在边栏上列出文章的许多不同的方式。例如,你可以创建一个包含5篇文章的列表,这5篇文章最近所得的评论最多:

<ul>Recently Commented Posts
   <?php c2c_get_recently_commented(5); ?>
</ul>


<ul>Recently Commented Posts
   <?php c2c_get_recently_commented(5); ?>
</ul>


There are several plugins that will generate a list of related posts to the one you are viewing. One of them, WordPress Related Entries Plugin by Wasabi, is easily activated and might appear like this in your sidebar to return a result of ten related posts in a list:

有几个插件,可以产生你将要浏览的相关文章的列表。其中的一个插件,WordPress Related Entries Plugin by Wasabi,非常容易激活,而且在你的边栏中,可能会返回列表中十篇相关的文章:

<li id="related"><?php _e('Related Articles'); ?>
<ul><?php related_posts(10, 10, '<li>', '</li>', '', '', false, false); ?></ul></li>
<li id="related"><?php _e('Related Articles'); ?>
<ul><?php related_posts(10, 10, '<li>', '</li>', '', '', false, false); ?></ul></li>

This is just the tip of the iceberg for ways of listing posts in your sidebar. You can find more on your visit to the plugin sites listed below.

上述只介绍了一点在边栏中列出文章的方式。你可以通过访问下面所列的插件站点找到更多的在边栏中列出文章的方式。

Meta Data

Meta 数据

Did you know you could put anything you want in your sidebar? Some people like to add the post meta data to the sidebar because it has information about the post and adds links to different categories, dates, and possibly even next and previous posts, all helping increase the visitor's navigation choices.

你知道你可以在边栏中放入任何你想要放入的内容吗?有的人喜欢向边栏中添加文章meta因为文章meta拥有关于文章的信息而且文章meta向不同的类别添加链接,日期,甚至添加上一篇文章和下一篇文章,所有的这些内容,都能够帮助访客导航。

WordPress:WordPress Lessons features an article on designing your Post Meta Data Section which will help you to customize this information in your sidebar.

WordPress课程拥有一篇文章,关于设计你的文章 Meta 数据部分,这个部分会帮助你自定义边栏中的信息。

Part of that meta data might be a little paragraph about who you are and what the site is about. You can add that using standard HTML and CSS and place it where you would like it to appear in the sidebar, such as:

meta data的一部分可能是一个段落关于,你是谁,以及站点是关于什么的。你可以使用HTML和CSS添加这个部分的meta data信息,并且将这个信息放到边栏中的你认可的位置上,例如:

<p class="aboutme">Have a passion for racing 
cars? Join the club. This site is dedicated to the hobby
and passion of car racing.</p>
<p class="aboutme">Have a passion for racing 
cars? Join the club. This site is dedicated to the hobby
and passion of car racing.</p>

Remember, it's your sidebar and you can add or remove anything you want.

记住,这是你的边栏,你可以添加或者删除任何内容:

Link Lists

链接列表

Lists of links, also called Blogrolls, are ways of listing different websites for your viewers to visit when they are done with your site, of course. This is also a handy way of featuring link exchanges.

链接列表,也成为友情链接,列出了不同的网站,当你的访客浏览你的站点的时候,可以点击这些链接,访问其它的站点。这种方式也非常便于交换链接。

Your link lists are controlled through the WordPress Link Manager. Each link can be displayed as text or as an image. In the WordPress Default Theme, your Links List is created with a conditional tag that only displays the Links List on the front page and not on the rest of the web pages within the Theme. The Classic Theme displays the Links List on every web page like this:

你的链接列表是通过WordPress链接管理器控制的。每个链接可以作为文本或者图像显示。在WordPress默认主题中,你的链接列表是通过条件式标签创建的,这个标签只会在首页显示列表,在主题内的其它网页中不会显示链接列表。经典主题在每个网页上都显示列表,像:

<?php get_links_list(); ?>
<?php get_links_list(); ?>

There are several ways of displaying your Links, and the above is just one example. You can also customize the display of the list by using the get_links() template tag. For example, let's say you want to display the links only for category 2 in a list featuring images and not the link text, and sort the links by the URL address:

显示链接有几种不同的方式,上面的方式只是其中的一个例子。你也可以通过使用get_links()模板标签,自定义链接列表的显示方式。例如,假如你只想要显示关于类别2的链接,而且只显示有图像而不是链接文本的链接,可以通过URL地址,给链接分类:

<ul><?php get_links(2, '<li>', '</li>', '', TRUE, 'url', FALSE); ?></ul>
<ul><?php get_links(2, '<li>', '</li>', '', TRUE, 'url', FALSE); ?></ul>

There are also a variety of Plugins for Links you can choose from to customize this information even more.

你也可以选择许多关于链接的插件更多地自定义这些信息。

Have your own set of links you want to share and you don't want to use the Link Manager? Want to highlight links to specific posts or pages? Check out the article on creating links to posts, pages, and categories.

你想要与他人分享自己的链接列表但是又不想使用链接管理器吗?你想要突出某些文章或者某些网页的链接吗?请查看关于创建文章,网页,和类别链接的文章。

Link List of Authors

作者的链接列表

If you have a requirement to present a list of authors (users) with links to their web-site, consider this example designed for the WordPress Default Theme's sidebar.php. Here the wpdb Class is used to collect the User ID Column (get_col) from the wp_users table. The User ID of All users is stored in the array called $user_ids . A foreach loop is used to 'cycle' through all the users in that array. In that foreach loop, the WordPress Function, get_userdata, is called to get all the Profile data for a given user, and finally, that user's Web-site ($user->user_url) and Display name publicly as ($user->dsiplay_name) is used to compose the "a href" tag link to each author's web-site:

如果你需要呈现作者(用户)的列表,附加链接到他们的站点的链接,考虑这个为WordPress默认主题的sidebar.php设计的例子。下面是 wpdb Class 是用来从from the wp_users 表格中。中得到collect the User ID Column (get_col)的。 所有用户的ID都储存在称为$user_ids数组中。 foreach loop 是用来 'cycle' through 那个数组中所有的用户。在 foreach loop中, WordPress 函数, get_userdata,得到调用以得到给定用户的 基本资料,最后,使用那个用户的网站 ($user->user_url) 并且 公开显示名称 ($user->dsiplay_name)作为 "a href" 标签链接到每个作者的网站:


<h2>Link list of authors:</h2>
<ul>
    <?php
    $order = 'user_nicename';
    $user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->users ORDER BY $order"); // query users
    foreach($user_ids as $user_id) : // start authors' profile "loop"
    $user = get_userdata($user_id);
    ?>
    <li><?php echo '<a href="' . $user->user_url . '">' . $user->display_name . '</a>'; ?><br /></li>
    <?php
    endforeach; // end of authors' profile 'loop'
    ?>
</ul>


<h2>Link list of authors:</h2>
<ul>
    <?php
    $order = 'user_nicename';
    $user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->users ORDER BY $order"); // query users
    foreach($user_ids as $user_id) : // 开始用户的基本资料 "loop"
    $user = get_userdata($user_id);
    ?>
    <li><?php echo '<a href="' . $user->user_url . '">' . $user->display_name . '</a>'; ?><br /></li>
    <?php
    endforeach; // 结束作者的'基本资料 'loop'
    ?>
</ul>

Different Sidebars Anyone?

不同的边栏Anyone?

Sidebars come and sidebars go...well, at least they do in the WordPress Default Theme. View the front, archive, or category page and you will see the sidebar. Click on a post title and view the post and you will see the sidebar disappear. How did this magic trick happen?

边栏出现,消失…至少,在WordPress默认主题中是这样的。查看字体,归档,或者类别网页,你就会看到边框。点击文章标题,阅读文章,你会发现边栏不见了。这种神奇的操作是怎样实现的?

WordPress 1.5 uses modular template files for the different parts and pieces of a site. We are currently discussing one of them, the sidebar.php. Some Themes feature different web pages beyond the index.php such as archive.php, single.php, search.php, and category.php. Each of these post pages can feature different sidebars, headers, and footers. Do you want to have the sidebar change dependent upon whether someone is viewing a category, archive, or the front page? We'll show you how.

WordPress1.5为站点的不同部分不同模块,使用模块模板文件,我们当前讨论其中的一个,sidebar.php。有些主题除了index.php外,拥有不同的网页,如archive.php, single.php, search.php, and category.php。每个文章网页都拥有不同的边栏,标头,和页底文字。你想要根据人们在浏览类别,归档以及首页时的不同情况来更改边栏吗?下面我们向你显示怎样更改。

By default, the call for the sidebar is: 默认情况下,调用边栏的命令是:

<?php get_sidebar(); ?>

<?php get_sidebar(); ?>

In the WordPress Default Theme, the single.php template file does not request a sidebar. If you view a single post, you will see that the post stretches across the space where the sidebar would have been. Click back to an archive, category, or the front page and the sidebar returns. This Theme has removed the call for the sidebar.

在WordPress默认主题中,single.php模板文件不需要边栏。如果你访问一篇单一的文章,你将会看到文章延伸在本应该出现边栏的位置。返回到归档,类别或者首页,边栏又会返回。这个主题已经移除了边栏的命令。

To have a sidebar be different on a different template page, instead of using the default template tag, you can use the PHP command INCLUDE.

要使得边栏在不同的模板网页上看起来不同,你可以使用PHP命令INCLUDE而不是使用默认模板标签。

<?php include ('sidebar2.php'); ?>

<?php include ('sidebar2.php'); ?>

Placed on the single.php or the category.php template file instead of the default tag, this different sidebar would appear on those web pages. You can then customize sidebar2.php to feature whatever information you would like so that it is different than the default sidebar.

将边栏放置在single.php 或者 category.php模板文件而不是默认标签上,这个不同的边栏就会出现在这些网页上。然后你可以自定义sidebar2.php放入任何你想要的信息,这样边栏就与默认的边栏不同了。

If you would like to have a different sidebar on the single.php template file, and another different sidebar visible when viewing an archive or category, edit the archive.php or category.php template files and change the sidebar call to:

如果你希望single.php模板文件上拥有一个不同的边栏,而且当你访问归档或者类别的时候,可以看到其它的不同的边栏,请编辑archive.php或者category.php模板文件并且将边栏命令更改为:

<?php include ('sidebar-cat.php'); ?>
<?php include ('sidebar-archive.php'); ?>

<?php include ('sidebar-cat.php'); ?>

<?php include ('sidebar-archive.php'); ?>

Actually, you can use whatever name you want. You can also set up WordPress:The Loop to call different sidebars dependent upon what you are viewing, and you can learn more about this technique in the WordPress Lesson on Exploring the Loop. You've got the basic idea, and from here, it's up to your imagination.

事实上,你可以使用任何你想要的名称。你也可以设置The Loop根据你浏览的不同内容,调用不同的边栏,你可以在WordPress课程中,探索Loop部分,学习这方面的内容。你已经了解了基本的内容,从现在开始,所有操作都取决于你的想像力了。

Sidebar Accessories

边栏附件

You can put anything you want in your sidebar. Want to have a random image or a bit of text that changes with every view of a page on your site? How about adding some asides which are little snips of post information? Want to add "buttons" or icons to indicate favorite sites, or sites that do validation, or awards you've won? How about weather reports or the latest news? You can honestly add anything you want to your sidebar. Here's more examples of what's possible.

你可以在边栏放入任何内容。每次访问站点上的网页的时候,希望边栏中有个随意的图像或者一些文本吗?在边栏中添加一些asides怎么样,这些asides是文章的部分摘要?想要在边栏中添加"按钮"或者图标,以暗示最喜爱的站点,或者暗示确认的站点,你获得奖励的站点?添加天气预报或者最新的新闻怎么样?你可以在边栏中添加任何你想要的内容。下面有一些例子。

Randomness

随意

Did you know you could have random images or text in your sidebar? Yep! There are a variety of scripts and techniques for creating random images on your site, images that change with every page or with each refreshing of the browser screen. The key to having these things in your sidebar is making sure they fit within your sidebar.

你知道你可以在边栏中放入随意的图像或者文本吗?可以使用许多种脚本和方法,在你的站点上创建随意的图像,这些图像会随着浏览器界面的更新而更改。在边栏中使用这些随意的图像的关键在于,这些图像能够适应你的边栏。

Vertical photographs and graphics tend to fit well with the long vertical column of the sidebar. You can also feature horizontal images as long as they don't exceed the width of the sidebar. If they do exceed the sidebar width, they can either overlap, or push the rest of your content around, messing up your lovely layout.

竖直的图片和图形适合于长栏的边栏。你也可以设计横向的图像,只要这个图像不超过边栏的宽度,即可。如果这些图像的确超过了边栏的宽度,图像可能会与边栏交叠,或者将你的其它内容挤向一边,将你可爱的布局混乱。

Here are some resources for creating random images: 下面是关于创建随意的图像的一些资源:


More random content, such as text that changes with each page view, can be added to your sidebar with the use of various plugins. This is a great feature if you want to have a random list of links to posts within your site, or random quotes or sayings, or other random bits of information.

通过使用不同的插件,更多随意的文本,例如每次打开网页的时候,会更改的文本,都能够出现在边栏中。如果你想要链接到站点文章的随意的链接列表,或者随意的引号或者话语,或者随意的信息,这是个非常强大的功能。



There are a lot of random things you can add to your sidebar, and you can find many of these at WordPress Extend.

你可以向边栏添加许多随意的内容,而且你可以在WordPress 扩展中找到许多相关的信息。

Asides

Asides

Asides are like mini-posts; little tidbits you can post that show up in your sidebar to leave a quick note about a topic or issue. These can be generated by using WordPress:Plugins or by taking advantage of the Link Manager.

Asides就如微型的文章;你可以发表的小栏报导,将会显示在你的边栏上,留下关于某个话题或者议题的便条。通过使用插件或者通过利用链接管理器都可以产生以上的操作。

Within Link Manager, create a link category called Elsewhere, for example. Enter the links you would like to have listed in your Asides section in your sidebar. Give them simple titles and descriptions to help identify the links. Then put the following in your sidebar where you want your Elsewhere Asides to appear:

在链接管理器内,例如,创立一个称为其它位置的链接类别。输入链接,你希望这个链接列在边栏的Asides部分。赋予链接简单的标题和描述以便于识别。然后将将下面的内容放入到你的边栏,你希望Elsewhere Asides出现的位置上。

<h3>Worth Visiting:</h3>
<ul id="elsewhere">
<?php get_links(5, '<li>', '</li>', ' ', FALSE, '_id', FALSE, FALSE, 3, FALSE, TRUE); ?>
</ul>
<h3>Worth Visiting:</h3>
<ul id="elsewhere">
<?php get_links(5, '<li>', '</li>', ' ', FALSE, '_id', FALSE, FALSE, 3, FALSE, TRUE); ?>
</ul>

The Elsewhere category has a category ID of 5 and the template tag get_links() displays three links in a list sorted by ID and showing titles to the links. Since it features the elsewhere style, you can customize the look. You can change the tag to show the descriptions of the links as well as the titles, so they might look like this:

Elsewhere类别拥有类别ID5而且模板标签get_links()根据ID的顺序显示三个链接并且显示链接标题。因为这是elsewhere样式,你可以自定义外观。你可以更改标签,显示链接和标题的描述,这样描述看起来像:

Worth Visiting
  • [[WordPress:#Asides|Alice in Wonderland]]
    Read this adventure online about the little girl lost through the looking glass
  • [[WordPress:#Asides|Little Red Riding Hood]]
    A walk in the woods turns wicked for a little girl visiting her grandmother.
  • [[WordPress:#Asides|Cinderella]]
    One wrong step sends a prince seeking his mystery princess, and a housekeeper becomes a princess.



Worth Visiting
  • [[WordPress:#Asides|爱丽丝奇境记]]
    在线阅读这篇小说,关于一个小女孩在一个镜子中迷失了
  • [[WordPress:#Asides|小红帽]]
    因为一个小女孩要去看望她的奶奶,林子中的那条路顿生险恶。
  • [[WordPress:#Asides|灰姑娘]]
    一位王子需要寻找神秘的公主,一名女佣成为了公主。


There are other ways of creating asides, including using some Plugins which turn "mini-posts" into asides:

创建asides,还有其它的方式,包括使用一些插件,将"微型文章"变为asides:



You can find more WordPress:Plugins and ways to create Asides by visiting the various WordPress Plugins sites listed below.

通过访问下面所列的不同的WordPress插件站点,你可以找到更多的插件和方式来创建Asides。

Buttons and Icons

按钮和图标

People enjoy listing their links and accomplishments in their sidebar highlighted by buttons and icons. Instead of listing a text link that proves your site has valid XHTML or CSS, you can create a link using the icon "awarded" to sites which pass the test. If your site has won an award, or is part of a webring, or is a member of a group, you can provide a graphic link to show that off, too. You can even use graphics to create links to your RSS feeds.

人们喜欢在边栏中列出链接及相关内容,通过按钮和图标突出边栏。你可以使用通过测试的站点"得到的"图标,来创建链接,而不是列出链接文本证明你的站点拥有有效的XHTML或者CSS。如果你的站点获得了奖励,或者是webring的一部分,或者是小组成员的一部分,你也可以提供图形链接显示这一点。你甚至可以使用图形创建链接,链接到你的RSS feeds。


The WordPress Default and Classic Themes provide a text link to validate your site. It looks like this:

WordPress默认和经典主题提供了链接文本,来证明你的站点。这个文本看起来像:

<li><a href="http://validator.w3.org/check/referer" 
title="This page validates as XHTML 1.0 Transitional">
Valid <abbr title="eXtensible HyperText Markup 
Language">XHTML</abbr></a></li>
<li><a href="http://validator.w3.org/check/referer" 
title="这个网页证实为 XHTML 1.0 Transitional">
Valid <abbr title="eXtensible HyperText Markup 
Language">XHTML</abbr></a></li>

To replace the link with a graphic link, like the "Valid XHTML" icon, copy the icon to your site and try the following example, changing the file name and folders to match your site:

要使用图形链接来替换链接,像"有效的 XHTML"图标,将图标复制到你的站点上并且尝试下面的例子,更改文件名和文件夹,以匹配你的站点:

<li><a href="http://validator.w3.org/check/referer" 
title="This page validates as XHTML 1.0 Transitional"><img 
src="http://example.com/graphics/icons/valid-xhtml10.gif" 
alt="Valid XHTML 1.0!" height="31" width="88" /></a></li>
<li><a href="http://validator.w3.org/check/referer" 
title="这个网页确认为 XHTML 1.0 Transitional"><img 
src="http://example.com/graphics/icons/valid-xhtml10.gif" 
alt="Valid XHTML 1.0!" height="31" width="88" /></a></li>

The same technique can be used to highlight an award your site has won or any other graphic link:

同样的方法也可以用来突出你的站点得到的奖励或者其它的图形链接:

<li><a href="http://example2.com/" 
title="Award Winning Site Awards"><img 
src="http://example.com/graphics/icons/award42.gif" 
alt="Award for Award Winning Site" height="50" width="50" /></a></li>


<li><a href="http://example2.com/" 
title="Award Winning Site Awards"><img 
src="http://example.com/graphics/icons/award42.gif" 
alt="Award for Award Winning Site" height="50" width="50" /></a></li>


Linking to graphics for Feeds is a little different from putting graphics in links. WordPress uses WordPress:Template Tags to display and coordinate feeds within a WordPress site. Without a graphic, a link to a RSS 2.0 Feed looks like this:

链接到Feeds的图形与将图形放入链接中有所不同。WordPress使用模板标签显示并且整理WordPress站点内的feeds。没有图像,一个链接到RSS 2.0 Feed的链接看起来像:

<li><a href="feed:<?php bloginfo('rss2_url'); ?>" 
title="<?php _e('Syndicate this site using RSS'); ?>">
<?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?>
</a></li>
<li><a href="feed:<?php bloginfo('rss2_url'); ?>" 
title="<?php _e('Syndicate this site using RSS'); ?>">
<?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?>
</a></li>

The template tag bloginfo() has parameters for the different feeds so you don't have to come up with the URL yourself. It's automatic. Now, let's replace the text with a graphic.

模板标签bloginfo()拥有不同的feeds的参数,这样你不需要自己提供URL。这是自动供应的。显示,我们用图形替换文本。

It used to be common that Feeds were identified by an orange colored box, but now, RSS Feeds can look like anything, but they tend to have a common look so they are identifiable from site to site. They feature a horizontal box with two "columns" of color, one bright and one light, saying RSS|FEED or RSS|Valid. You can make it say whatever you want, as long as it points your visitors towards this feature. Feedforall's DYI Feed Graphic Designer allows you to easily design your own feed icon.

通常Feed是由橘红色的框识别的,但是现在,RSS Feeds可以看起来像任何东西,但是RSS Feeds一般有一个共同的外观,这样在不同的站点上可以得到确认。RSS Feeds拥有一个横向的框,有用两"栏"颜色,一个明亮,一个暗淡,显示RSS|FEED 或者RSS|Valid。你可以将这个放在任何位置,只要向你的放个指向这个功能即可。Feedforall's DYI Feed Graphic Designer能够使你轻易地设计自己的feed图标。

The Feed Icons site provides graphical icons using the icon created by the Mozilla Foundation and later adopted by Microsoft. A graphical icon helps avoid some of the issues currently associated with the wide variety of text-based icons.

Feed 图标站点提供了图形图标,使用Mozilla Foundation以及以后由Microsoft上传的图标。图形图标能够避免一些问题,当前很多以文本为基础的图标可能都会有这些问题。

To use a different icon, here is how it might look:

要使用一个不同的图标,下面是图标可能出现的外观:

<li><a href="feed:<?php bloginfo('rss2_url'); ?>" 
title="<?php _e('Syndicate this site using RSS'); ?>">
<img src="http://example.com/graphics/icons/rssfeed20.gif" 
alt="RSS Feed 2.0" height="20" width="75" /></a></li>


<li><a href="feed:<?php bloginfo('rss2_url'); ?>" 
title="<?php _e('Syndicate this site using RSS'); ?>">
<img src="http://example.com/graphics/icons/rssfeed20.gif" 
alt="RSS Feed 2.0" height="20" width="75" /></a></li>

We've given you some examples of how to create graphic links, buttons, or icons in your sidebar, the rest is up to you.

我们向你显示了一些例子,关于怎样在你的边栏中创建图形链接,按钮,或者图标,其它的操作就取决于你自己了。

Weather, Location, and Times

天气,位置和时间

There are so many things you could put into your sidebar, we could go on forever. Some of the most popular elements are weather bulletins for the weather wherever the site administrator calls home, GPS and location information, and even the time in different time zones. There is even a plugin that you can use to list upcoming dates, events, and holidays, with a countdown until the date.

你可以在边栏中放入许多内容,我们会继续努力操作。一些非常受欢迎的内容包括关于天气情况的天气报告,站点管理员calls home时候,GPS和位置信息,以及不同时区的时间信息。你甚至可以使用一个插件,列出即将开始的时间,或者假期的时间,在日期的下面设计一个倒计时。

If you can't find a plugin that does what you want it to do in your sidebar, you can also write your own plugin and share that with the world to use in their sidebars.

如果你没有找到插件,帮助你执行边栏中的某个操作,你也可以编写自己的插件,并且与他人分享使用边栏。

Plugin Resources

插件资源

We've only mentioned a few of the many different WordPress:Plugins you can use in the designing and customization of your sidebar in WordPress. You can find these and more from the various plugin resources listed below or search the Internet for more.

我们只提及了许多插件中的一些,你可以使用这些插件自定义WordPress中的边栏。你可以从下面列出的不同插件资源中找到更多的插件,或者你可以搜索网络,找到更多的插件。

Follow the instructions very carefully as provided by the plugin author. If you have trouble with the plugin, contact the author's site first, then the author, and if that doesn't help, do a search on the Internet for help and then visit the WordPress Forum for further assistance.

仔细地遵循插件作者提供的指导说明。如果你操作插件时,遇到了问题,你可以首先联系插件作者的站点,然后再联系插件作者,如果还是没有解决问题,你可以搜索网络寻求帮助,然后访问[1]得到更多的帮助。



留言