WordPress: Good Navigation Links:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
__TOC__
__TOC__
It helps people move around your site when you have a clean navigation menu in the sidebar and/or the footer.  It helps people find the posts and articles you want them to find.  There are a variety of methods for user friendly site navigation on your WordPress site.
当你在工具条和/或者页脚上有一个简明的导航时,人们就可以在你的站点上到处浏览。它帮助人们找到你想要他们阅读的帖子和文章。有许多方法可以帮助用户在你的WordPress站点上友好地导航。
当你在工具条和/或者页脚上有一个简明的导航时,人们就可以在你的站点上到处浏览。它帮助人们找到你想要他们阅读的帖子和文章。有许多方法可以帮助用户在你的WordPress站点上友好地导航。


Helping the user use your site means putting things where they can find them.  Following the newsletter formats from the days of print, most website users are used to looking for intra-site links on the ''sides'' and ''bottom'' of a web page.  As a designer, you can put them anywhere you want, but let's stick with the conventional placement for now.  After all, we want our WordPress sites to be user-friendly, right?
帮助用户使用你的站点意味着将内容放到他们可以找到的位置。在发表的那一天,遵循时事通讯的格式,大多数用户习惯于在一个网页的''侧面'' 和 ''底部''寻找站点内部链接。作为一个设计者,你可以将它们放在任何你希望的位置,但是目前让我们还是遵循传统的位置方法。毕竟,我们希望WordPress站点成为用户友好型的,对吗?
帮助用户使用你的站点意味着将内容放到他们可以找到的位置。在发表的那一天,遵循时事通讯的格式,大多数用户习惯于在一个网页的''侧面'' 和 ''底部''寻找站点内部链接。作为一个设计者,你可以将它们放在任何你希望的位置,但是目前让我们还是遵循传统的位置方法。毕竟,我们希望WordPress站点成为用户友好型的,对吗?
In the two [[WordPress:Using Themes|WordPress Themes]] that come with your WordPress installation, both use a '''sidebar''' to hold most of the site's navigation links. Other Themes may use navigational aids in the [[WordPress:Designing Headers|header]] and footer. While these navigation links can be displayed in any [[WordPress:Templates|template file]], typically, the navigation links include:


你的WordPress安装带的两个[[WordPress:Using Themes|WordPress 主题]],都使用一个'''条框'''来承载大多数的导航站点链接。其它的主题可能在[[WordPress:Designing Headers|页眉]]和页脚上使用导航帮助。虽然这些导航链接可以在任何的[[WordPress:Templates|模板文件]]中显示,通常情况下,导航链接包括:
你的WordPress安装带的两个[[WordPress:Using Themes|WordPress 主题]],都使用一个'''条框'''来承载大多数的导航站点链接。其它的主题可能在[[WordPress:Designing Headers|页眉]]和页脚上使用导航帮助。虽然这些导航链接可以在任何的[[WordPress:Templates|模板文件]]中显示,通常情况下,导航链接包括:
* [[WordPress:Pages]]
* [[WordPress:#Categories|Categories]]
* [[WordPress:#Archives|Archives]] (by month)
* [[WordPress:Links Manager|Links]]
* [[WordPress:#Admin_or_Meta|Admin or Meta]]


* [[WordPress:Pages|网页]]
* [[WordPress:Pages|网页]]
* [[WordPress:#Categories|类别]]
* [[#WordPress:Categories|类别]]
* [[WordPress:#Archives|归档]] (按月的)
* [[#WordPress:Archives|归档]] (按月的)
* [[WordPress:Links Manager|链接]]
* [[WordPress:Links Manager|链接]]
* [[WordPress:#Admin_or_Meta|管理或者 Meta]]
* [[#WordPress:Admin_or_Meta|管理或者 Meta]]
 
 
The [[WordPress:Template Tags|template tags]] associated with generating this list of navigation links are found in the default WordPress Themes's sidebar inside of a [[WordPress:Styling_Lists_with_CSS|nested list]]. Let's look at each of these tags individually and then look how to expand the use of navigational aids on your WordPress site.


[[WordPress:Template Tags|模板标签]]与产生这个列表的导航链接可以在默认的WordPress工具栏中找到而不是在一个[[WordPress:Styling_Lists_with_CSS|嵌套的列表]]中找到。让我们个别地看看每个标签,然后看看怎样扩展你的WordPress站点导航设备。
[[WordPress:Template Tags|模板标签]]与产生这个列表的导航链接可以在默认的WordPress工具栏中找到而不是在一个[[WordPress:Styling_Lists_with_CSS|嵌套的列表]]中找到。让我们个别地看看每个标签,然后看看怎样扩展你的WordPress站点导航设备。
==Pages==


==网页==
==网页==


With the introduction of WordPress v1.5, [[WordPress:Pages]] were available to help the administrator create individual Pages outside of the [[WordPress:The_Loop|WordPress Loop]] such as '''Contact Us''', '''About Us''', and '''What's New'''.  The [[WordPress:Template Tags|template tags]] used to display the list of individual Pages is [[WordPress:Template Tags/wp_list_pages|wp_list_pages()]].
根据WordPress v1.5的说明,[[WordPress:Pages|网页]]能够帮助管理者在[[WordPress:The_Loop|WordPress Loop]]外创建个别的网页,例如'''联系我们''', '''关于我们''',和'''什么内容是新的'''。[[WordPress:Template Tags|模板标签]]惯常显示的个人网页是[[WordPress:Template Tags/wp_list_pages|wp_list_网页()]]。
根据WordPress v1.5的说明,[[WordPress:Pages|网页]]能够帮助管理者在[[WordPress:The_Loop|WordPress Loop]]外创建个别的网页,例如'''联系我们''', '''关于我们''',和'''什么内容是新的'''。[[WordPress:Template Tags|模板标签]]惯常显示的个人网页是[[WordPress:Template Tags/wp_list_pages|wp_list_网页()]]。


<pre><?php wp_list_pages(); ?></pre>
<pre><?php wp_list_pages(); ?></pre>
<pre><?php wp_list_pages(); ?></pre>
There are many ways of customizing the <tt>wp_list_pages()</tt> tag to be more useful to your users.  A long list of Pages and sub-Pages can go on for quite a while, so you might want to only feature the most important Pages in your sidebar.


有许多方式来自定义<tt>wp_list_pages()</tt>标签使它对你的用户更有用。一个长的网页和子网页的列表,可以运行好一会儿,因此你也许想特写你的条框中最重要的网页。
有许多方式来自定义<tt>wp_list_pages()</tt>标签使它对你的用户更有用。一个长的网页和子网页的列表,可以运行好一会儿,因此你也许想特写你的条框中最重要的网页。
To exclude some Pages from your list, you can set the parameters for '''exclude'''.  The following example excludes Pages with the Page-ID numbers of 17 and 38.
清除你的列表上的一些网页,你可以将参数设置为'''清除'''。下面的例子将网页-ID数字是17和38的网页清除了。
清除你的列表上的一些网页,你可以将参数设置为'''清除'''。下面的例子将网页-ID数字是17和38的网页清除了。
<pre><ul>
<?php wp_list_pages('exclude=17,38' ); ?>
</ul></pre>


<pre><ul>
<pre><ul>
<?php wp_list_pages('清除=17,38' ); ?>
<?php wp_list_pages('清除=17,38' ); ?>
</ul></pre>
</ul></pre>
To learn more about customizing the <tt>wp_list_pages()</tt> template tag, visit the Template Tag page for [[WordPress:Template Tags/wp_list_pages|wp_list_pages()]].


学习更多的自定义<tt>wp_list_pages()</tt>模板标签,访问[[WordPress:Template Tags/wp_list_pages|wp_list_网页()]]的模板标签网页。
学习更多的自定义<tt>wp_list_pages()</tt>模板标签,访问[[WordPress:Template Tags/wp_list_pages|wp_list_网页()]]的模板标签网页。
==Categories==


==类别==
==类别==


There are two template tags which create the category list in your navigation menu:  [[WordPress:Template_Tags/wp_list_cats|wp_list_cats()]] and [[WordPress:Template_Tags/list_cats|list_cats()]].  Both work basically the same but the first one uses [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean parameters]] and the second one uses [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters|strings]].  Which you use is up to you.
有两个模板标签创建了你的导航菜单的类别列表:[[WordPress:Template_Tags/wp_list_cats|wp_list_cats()]] 和[[WordPress:Template_Tags/list_cats|list_cats()]]。两个的运行基本相同,但是第一个使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean 参数]] 和 第二个使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters|strings]]
有两个模板标签创建了你的导航菜单的类别列表:[[WordPress:Template_Tags/wp_list_cats|wp_list_cats()]] 和[[WordPress:Template_Tags/list_cats|list_cats()]]。两个的运行基本相同,但是第一个使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean 参数]] 和 第二个使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters|strings]]
你自己决定使用哪个。.
你自己决定使用哪个。.


The default usage of the category list tags are:
默认的类别列表标签的用法是:
默认的类别列表标签的用法是:
<pre><?php wp_list_cats(); ?>
<?php list_cats(); ?></pre>
<pre><?php wp_list_cats(); ?>
<pre><?php wp_list_cats(); ?>


<?php list_cats(); ?></pre>
<?php list_cats(); ?></pre>
Again, like the [[WordPress:#Pages|Pages template tag]], you can use '''exclude''' to limit the categories you want listed, making it easier for the user to pick from only a few instead of twenty or thirty categories.  The following example excludes category-IDs 10 and 15.


同样地,像[[WordPress:#Pages|网页模板标签]],你可以使用'''exclude'''来限定你想要列出的类别,用户从几个类别中而不是从二十或者三十个类别中挑选,选起来要更加简单。以下的例子清除了类别-IDs10和15。
同样地,像[[WordPress:#Pages|网页模板标签]],你可以使用'''exclude'''来限定你想要列出的类别,用户从几个类别中而不是从二十或者三十个类别中挑选,选起来要更加简单。以下的例子清除了类别-IDs10和15。
<pre><ul>
<?php wp_list_cats('exclude=10, 15'); ?>
</ul></pre>
<pre><ul>
<pre><ul>
<?php wp_list_cats('exclude=10, 15'); ?>
<?php wp_list_cats('exclude=10, 15'); ?>
</ul></pre>
</ul></pre>
If you would like only to feature the '''children''' or ''sub-categories'' of one or more categories in your category list, you can use the '''child_of''' parameter.


如果你只想显示你的类别列表中的一个或者更多类别中的'''孩子''' 或者 ''子类别'',你可以选择参数的'''孩子'''。
如果你只想显示你的类别列表中的一个或者更多类别中的'''孩子''' 或者 ''子类别'',你可以选择参数的'''孩子'''。
<pre><ul>
<?php wp_list_cats('child_of=8, 14'); ?>
</ul></pre>
<pre><ul>
<pre><ul>
<?php wp_list_cats('child_of=8, 14'); ?>
<?php wp_list_cats('child_of=8, 14'); ?>
</ul></pre>
</ul></pre>
To learn more about customizing the these template tags, visit the Template Tag page for [[WordPress:Template Tags/wp_list_cats|wp_list_cats()]] and [[WordPress:Template_Tags/list_cats|list_cats()]].


学习更多的自定义这些模板标签的内容,访问关于[[WordPress:Template Tags/wp_list_cats|wp_list_cats()]] 和[[WordPress:Template_Tags/list_cats|list_cats()]]的模板标签网页。
学习更多的自定义这些模板标签的内容,访问关于[[WordPress:Template Tags/wp_list_cats|wp_list_cats()]] 和[[WordPress:Template_Tags/list_cats|list_cats()]]的模板标签网页。
==Archives==
==归档==
==归档==


Like the [[WordPress:#Categories|categories]] template tags, there are two tags which produce the Archives date-based list of links: [[WordPress:Template Tags/wp_get_archives|wp_get_archives()]] and [[WordPress:Template_Tags/get_archives|get_archives()]]. Both work basically the same but the first one uses [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean parameters]] and the second one uses [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters|strings]].
[[#WordPress:Categories|类别]]模板标签类似,有两个标签产生出以日期为基础的归档列表的链接:[[WordPress:Template Tags/wp_get_archives|wp_get_归档()]] 和[[WordPress:Template_Tags/get_archives|get_archives()]]。两个运行基本相同,但是第一个使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean 参数]] 和第二个使用 [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters|strings]]。
 
与[[WordPress:#Categories|类别]]模板标签类似,有两个标签产生出以日期为基础的归档列表的链接:[[WordPress:Template Tags/wp_get_archives|wp_get_归档()]] 和[[WordPress:Template_Tags/get_archives|get_archives()]]。两个运行基本相同,但是第一个使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean 参数]] 和第二个使用 [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters|strings]]。
 
The Archive template tags are the only way to list posts in WordPress without a [[WordPress:Plugins|plugin]].  You can limit the number of posts to show in your Archives template tags, but you can't show ''all'' of them, only a limited number.  The tag, however, will allow you to show the most recent by month, week, day, or the most recent posts.


归档模板标签是没有用一个[[WordPress:Plugins|插件]]在WordPress中列出文章的唯一的方法。你可以限定你的归档模板标签上的文章数目,但是你不能显示''所有的'',只能显示一个少数的。然而,标签可以让你显示最近每月,每星期或者每天的文章,或者更近的文章。
归档模板标签是没有用一个[[WordPress:Plugins|插件]]在WordPress中列出文章的唯一的方法。你可以限定你的归档模板标签上的文章数目,但是你不能显示''所有的'',只能显示一个少数的。然而,标签可以让你显示最近每月,每星期或者每天的文章,或者更近的文章。




The default usage of the archives list tags are:
归档列表标签的默认的用法是:
归档列表标签的默认的用法是:


第139行: 第63行:
<?php get_archives(); ?></pre>
<?php get_archives(); ?></pre>


<pre><?php wp_get_archives(); ?>
<?php get_archives(); ?></pre>
To show the most recent three months of posts by month, you would use the following:
显示最近三个月中每个月的帖子,你可能要使用下面的:
显示最近三个月中每个月的帖子,你可能要使用下面的:
<pre><ul>
<?php get_archives('monthly','3'); ?>
</ul></pre>
<pre><ul>
<pre><ul>
<?php get_archives('monthly','3'); ?>
<?php get_archives('monthly','3'); ?>
</ul></pre>
</ul></pre>


Displaying the archives by date, you can show the most recent 15 days worth of posts:
按日期归档,你可以显示最近十五天有价值的文章:
按日期归档,你可以显示最近十五天有价值的文章:
<pre><ul>
<?php wp_get_archives('type=daily&limit=15'); ?>
</ul></pre>
<pre><ul>
<pre><ul>
<?php wp_get_archives('type=daily&limit=15'); ?>
<?php wp_get_archives('type=daily&limit=15'); ?>
第175行: 第74行:




If you would like to show the actual posts, you can use the parameter '''postbypost''' which displays the most recent posts, with the number set by the '''limit''' parameter.  To show the last 25 posts by post title:
如果你想显示整篇文章,你可以使用参数'''postbypost''',显示最近的文章,由'''limit'''参数设置数字。通过文章标题显示最近的25篇文章:
如果你想显示整篇文章,你可以使用参数'''postbypost''',显示最近的文章,由'''limit'''参数设置数字。通过文章标题显示最近的25篇文章:
<pre><ul>
<pre><ul>
<?php wp_get_archives('type=postbypost&limit=25'); ?>
<?php wp_get_archives('type=postbypost&limit=25'); ?>
</ul></pre>
</ul></pre>
<pre><ul>
<?php wp_get_archives('type=postbypost&limit=25'); ?>
</ul></pre>
To learn more about customizing the these template tags, visit the Template Tag page for [[WordPress:Template_Tags/get_archives|get_archives()]] and [[WordPress:Template Tags/wp_get_archives|wp_get_archives()]].


学习更多的关于自定义这些模板标签的内容,访问关于[[WordPress:Template_Tags/get_archives|得到归档()]] 和[[WordPress:Template Tags/wp_get_archives|wp得到归档()]]的网页。
学习更多的关于自定义这些模板标签的内容,访问关于[[WordPress:Template_Tags/get_archives|得到归档()]] 和[[WordPress:Template Tags/wp_get_archives|wp得到归档()]]的网页。
==Links==


==链接==
==链接==
The Links list of links come from WordPress' [[WordPress:Links Manager]] feature which allows displaying of external links, such as a blogroll, the user would like to feature on his or her site.  These links are generated by several different template tags:


链接的链接列表来自WordPress的[[WordPress:Links Manager|链接管理]]功能,允许显示外部链接,例如一个友情链接,用户希望将这个显示在他或者她的站点上的。这些链接是由几个不同的模板标签产生的。
链接的链接列表来自WordPress的[[WordPress:Links Manager|链接管理]]功能,允许显示外部链接,例如一个友情链接,用户希望将这个显示在他或者她的站点上的。这些链接是由几个不同的模板标签产生的。
* [[WordPress:Template_Tags/get_links_list|get_links_list]]: Displays a nested HTML unordered list of all links as defined in the Links Manager, sorted under link category headings.
* [[WordPress:Template_Tags/get_links_list|得到链接列表]]:显示一个链接管理器中定义的,在链接类别标题下分类的,所有链接的一个嵌套的HTML不规则列表。
* [[WordPress:Template_Tags/get_links_list|得到链接列表]]:显示一个链接管理器中定义的,在链接类别标题下分类的,所有链接的一个嵌套的HTML不规则列表。
* [[WordPress:Template_Tags/wp_get_links|wp_get_links]]: Displays links associated with a numeric link category ID.
* [[WordPress:Template_Tags/wp_get_links|wp_得到链接]]:显示一个与数字链接类别ID有关的链接。
* [[WordPress:Template_Tags/wp_get_links|wp_得到链接]]:显示一个与数字链接类别ID有关的链接。
* [[WordPress:Template_Tags/get_links|get_links]]: Like wp_get_links(), this tag allows the user to control how the links are displayed by tag parameters, not through the [[WordPress:Administration Panels|Administration]] > [[WordPress:Administration_Panels#Blogroll_-_Putting_the_Inter_in_the_Internet|Links]] Page (useful when displaying links on more than one template).
* [[WordPress:Template_Tags/get_links|得到链接]]: 像wp_get_links()一样,标签允许用户通过标签参数来控制链接的显示,而不是通过[[WordPress:Administration Panels|管理]] > [[WordPress:Administration_Panels#Blogroll_-_Putting_the_Inter_in_the_Internet|链接]]页面来控制链接的显示 (在一个以上的模板上显示链接有用)。
* [[WordPress:Template_Tags/get_links|得到链接]]: 像wp_get_links()一样,标签允许用户通过标签参数来控制链接的显示,而不是通过[[WordPress:Administration Panels|管理]] > [[WordPress:Administration_Panels#Blogroll_-_Putting_the_Inter_in_the_Internet|链接]]页面来控制链接的显示 (在一个以上的模板上显示链接有用)。
* [[WordPress:Template_Tags/wp_get_linksbyname|wp_get_linksbyname]]: Displays links associated with the named link category
* [[WordPress:Template_Tags/wp_get_linksbyname|wp_通过名称得到链接]]:显示命名了的链接类别有关的链接。
* [[WordPress:Template_Tags/wp_get_linksbyname|wp_通过名称得到链接]]:显示命名了的链接类别有关的链接。
* [[WordPress:Template_Tags/get_linksbyname|get_linksbyname]]: Like wp_get_linksbyname(), this tag displays links by category, but allows the user to control how they are displayed by tag parameters.
* [[WordPress:Template_Tags/get_linksbyname|通过名称得到链接]]:与wp_通过名称得到链接相似(),这个标签通过类别来显示链接,但是允许用户通过标签参数来控制它们的显示。
* [[WordPress:Template_Tags/get_linksbyname|通过名称得到链接]]:与wp_通过名称得到链接相似(),这个标签通过类别来显示链接,但是允许用户通过标签参数来控制它们的显示。


For examples and more information on the specific use of each of these different template tags, click on the tag name above.
关于这些不同的标签,每个的特别的用法的例子和更多的信息,点击以上的标签名。
关于这些不同的标签,每个的特别的用法的例子和更多的信息,点击以上的标签名。
== Admin or Meta ==
== 管理或者 Meta ==
== 管理或者 Meta ==
The Admin or Meta list of links in the WordPress sidebar are the links which are used by the Administrator, if logged in, to access the [[WordPress:Administration_Panels|administration panels]] of the site. They may also feature [[WordPress:Glossary#RSS|RSS]] Feeds and other information related to the administration or use of the site.  Check the following tags for more information on which ones you might want on your site to assist yourself and other registered users:
WordPress工具条中的管理或者Meta链接列表,是有管理者使用的链接,如果链接了主机,就可以访问站点的[[WordPress:Administration_Panels|管理面板]]。它们也可能有[[WordPress:Glossary#RSS|RSS]] Feeds和其它的与管理或者站点使用有关的信息。查看以下的标签得到更多的信息,关于你在站点上想使用哪个来帮助你自己和其他的注册的用户:
WordPress工具条中的管理或者Meta链接列表,是有管理者使用的链接,如果链接了主机,就可以访问站点的[[WordPress:Administration_Panels|管理面板]]。它们也可能有[[WordPress:Glossary#RSS|RSS]] Feeds和其它的与管理或者站点使用有关的信息。查看以下的标签得到更多的信息,关于你在站点上想使用哪个来帮助你自己和其他的注册的用户:
* [[WordPress:Template_Tags/wp_register|wp_register()]] - Registering on your site for comments and other administrative purposes
* [[WordPress:Template_Tags/wp_register|wp_注册()]] –关于评论或者其它的管理目的,在你的站点上注册
* [[WordPress:Template_Tags/wp_register|wp_注册()]] –关于评论或者其它的管理目的,在你的站点上注册
* [[WordPress:Template_Tags/wp_loginout|wp_loginout()]] - Logging in and out of your site's administration panel with a password
* [[WordPress:Template_Tags/wp_loginout|wp_退出系统()]] –使用一个密码,登录和退出你的站点的管理面板。
* [[WordPress:Template_Tags/wp_loginout|wp_退出系统()]] –使用一个密码,登录和退出你的站点的管理面板。
 
* [[WordPress:Template Tags/bloginfo|bloginfo()]] – 可以使用许多的参数来为站点和评论设置RSS/Atomz/RDF feeds。
* [[WordPress:Template Tags/bloginfo|bloginfo()]] - Various parameters available for setting the RSS/Atomz/RDF feeds for the site and comments
 
[[WordPress:Template Tags/bloginfo|bloginfo()]] – 可以使用许多的参数来为站点和评论设置RSS/Atomz/RDF feeds。
 
* [[WordPress:Template Tags]] - For more information on various template tags to use on your site
 
* [[WordPress:Template Tags|模板标签]] – 在你的站点上使用不同的模板的更多的信息
* [[WordPress:Template Tags|模板标签]] – 在你的站点上使用不同的模板的更多的信息
== Other Navigation Locations ==
==其它的导航场所 ==
==其它的导航场所 ==
In addition to the sidebar, you can help your users navigate through your site with navigation tags used elsewhere, such as in the ''header'' and ''footer'' of your site.  Using the above template tags for navigation links, you can style the link lists as [[WordPress:Creating_Horizontal_Menus|horizontal menus]] instead of vertical lists.
除了工具条外,你可以帮助你的用户通过使用其它位置的导航标签,在你的站点上导航,例如在你的站点的''页眉'' 和''页脚''上的导航标签。为导航链接使用以上的模板标签,你可以将链接列表设计为[[WordPress:Creating_Horizontal_Menus|横向菜单]]而不是垂直的列表。
除了工具条外,你可以帮助你的用户通过使用其它位置的导航标签,在你的站点上导航,例如在你的站点的''页眉'' 和''页脚''上的导航标签。为导航链接使用以上的模板标签,你可以将链接列表设计为[[WordPress:Creating_Horizontal_Menus|横向菜单]]而不是垂直的列表。
=== Link to Posts and Pages ===


=== 导向文章和网页的链接 ===
=== 导向文章和网页的链接 ===
Often in these narrow areas, you may want to only highlight specific posts or [[WordPress:Pages]] to save space and direct the user to specific areas to continue their browsing.  To include a specific link to a post or Page, you can use the [[WordPress:Template Tags/get_permalink|get_permalink()]] template tag.
在这些狭隘的区域里,通常,你只想要突出特别的文章或者[[WordPress:Pages|网页]]来保存空间或者将用户引导到特别的区域,使他们继续浏览。使一个帖子或者一个网页包含一个特别的链接,你可以使用[[WordPress:Template Tags/get_permalink|得到_permalink()]]模板标签。
在这些狭隘的区域里,通常,你只想要突出特别的文章或者[[WordPress:Pages|网页]]来保存空间或者将用户引导到特别的区域,使他们继续浏览。使一个帖子或者一个网页包含一个特别的链接,你可以使用[[WordPress:Template Tags/get_permalink|得到_permalink()]]模板标签。


The following example presents links to post-ID numbers 1 and 10 and lists the categories on the site, excluding category-ID 2 and 4.


下面的例子显示了对于帖子-ID数字1和10的链接,并且链接了站点上的类别,除了类别-ID2和4。
下面的例子显示了对于帖子-ID数字1和10的链接,并且链接了站点上的类别,除了类别-ID2和4。
<pre><li><a href="<?php echo get_permalink(1); ?>">About My Blog</a></li>
<li><a href="<?php echo get_permalink(10); ?>">About Me</a></li>
<?php wp_list_cats('exclude=2, 4'); ?>
</pre>




第279行: 第112行:
</pre>
</pre>


The list might look like this:
链接可能看起来像:
链接可能看起来像:
<div style="border:1px solid blue; width:50%; font-size: 120%; margin: 20px; padding:20px">
<div style="border:1px solid blue; width:50%; font-size: 120%; margin: 20px; padding:20px">


<div style="border:1px solid blue; width:50%; font-size: 120%; margin: 20px; padding:20px">
* [[#WordPress:Other Navigation Locations|关于我的博客]]
 
* [[#WordPress:Other Navigation Locations|关于我]]
 
* [[#WordPress:Other Navigation Locations|我的故事]]
* [[WordPress:#Other Navigation Locations|About My Blog]]
* [[#WordPress:Other Navigation Locations|我的旅行]]
* [[WordPress:#Other Navigation Locations|About Me]]
* [[#WordPress:Other Navigation Locations|我的朋友]]</div>
* [[WordPress:#Other Navigation Locations|My Stories]]
* [[WordPress:#Other Navigation Locations|My Travels]]
* [[WordPress:#Other Navigation Locations|My Friends]]</div>
 
 
 
 
* [[WordPress:#Other Navigation Locations|关于我的博客]]
* [[WordPress:#Other Navigation Locations|关于我]]
* [[WordPress:#Other Navigation Locations|我的故事]]
* [[WordPress:#Other Navigation Locations|我的旅行]]
* [[WordPress:#Other Navigation Locations|我的朋友]]</div>
 
 
 
===Next and Previous Posts===


===上一篇和下一篇帖子===
===上一篇和下一篇帖子===
There are two other sets of navigational aids to consider as you design your site.  Both of these sets involve moving a user through your site from one post to another. 


当你设计你的站点的时候,需要考虑另外两套导航设备。这两套设置都涉及到将你的站点上的用户从一个帖子导航到另一个帖子。
当你设计你的站点的时候,需要考虑另外两套导航设备。这两套设置都涉及到将你的站点上的用户从一个帖子导航到另一个帖子。
The first set is featured only on the non-single/non-permalink web pages and is the template tag [[WordPress:Template_Tags/posts_nav_link|posts_nav_link()]].  This tag creates two links at the bottom of the page within the [[WordPress:The_Loop|WordPress Loop]] to display the '''next''' and '''previous''' pages of the index, archives, searches, and categories.


第一套导航设备只出现在非单一的/非-permalink网页上,而且是模板标签[[WordPress:Template_Tags/posts_nav_link|posts_nav_link()]]。这个标签在[[WordPress:The_Loop|WordPress Loop]]里的网页底部创建了两个链接,来显示索引,归档,搜索,和类别的'''上一个''' 和 '''下一个'''网页。
第一套导航设备只出现在非单一的/非-permalink网页上,而且是模板标签[[WordPress:Template_Tags/posts_nav_link|posts_nav_link()]]。这个标签在[[WordPress:The_Loop|WordPress Loop]]里的网页底部创建了两个链接,来显示索引,归档,搜索,和类别的'''上一个''' 和 '''下一个'''网页。
 
By default, the <tt>posts_nav_link</tt> looks like this:
默认情况下,<tt>posts_nav_link</tt>看起来像这样:
默认情况下,<tt>posts_nav_link</tt>看起来像这样:


<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[WordPress:#Other Navigation Locations|&laquo; Previous Page]]  &#8212; [[WordPress:#Other Navigation Locations|Next Page &raquo;]]</div>
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[#WordPress:Other Navigation Locations|&laquo; 上一个网页]]  &#8212; [[#WordPress:Other Navigation Locations|下一个网页 &raquo;]]</div>
 
 
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[WordPress:#Other Navigation Locations|&laquo; 上一个网页]]  &#8212; [[WordPress:#Other Navigation Locations|下一个网页 &raquo;]]</div>
 
 
To learn more about changing the look of this link, visit the Template Tag page for [[WordPress:Template_Tags/posts_nav_link|posts_nav_link()]].
 
学习更多的关于改变这个链接的外观的内容,访问模板标签网页得到[[WordPress:Template_Tags/posts_nav_link|posts_nav_link()]]。
学习更多的关于改变这个链接的外观的内容,访问模板标签网页得到[[WordPress:Template_Tags/posts_nav_link|posts_nav_link()]]。
The other set of navigational aids for moving through your site control the '''next post''' and '''previous post''' links typically found at the bottom of your single/permalink post. These direct the user to move to the next chronologically created post or the previous.
另一套导航设备用来在你的站点上移动,来控制通常在你的单一的/permalink帖子底部出现的'''下一个帖子'''和'''上一个帖子'''。这些能引导用户来到按时间顺序创建的上一个或者下一个帖子。
另一套导航设备用来在你的站点上移动,来控制通常在你的单一的/permalink帖子底部出现的'''下一个帖子'''和'''上一个帖子'''。这些能引导用户来到按时间顺序创建的上一个或者下一个帖子。
The template tags are [[WordPress:Template_Tags/previous_post|previous_post()]] and [[WordPress:Template_Tags/next_post|next_post()]].  These can be styled in several different ways, using the '''next post''' and '''previous post''' titles or using the actual titles of the next and previous posts.
模板标签是[[WordPress:Template_Tags/previous_post|上一篇帖子()]] 和 [[WordPress:Template_Tags/next_post|下一篇帖子()]]。这些可以以几种不同的方式来设计,使用'''下一个帖子'''和'''上一个帖子'''标题或者使用使用上一个和下一个帖子的真正的标题。
模板标签是[[WordPress:Template_Tags/previous_post|上一篇帖子()]] 和 [[WordPress:Template_Tags/next_post|下一篇帖子()]]。这些可以以几种不同的方式来设计,使用'''下一个帖子'''和'''上一个帖子'''标题或者使用使用上一个和下一个帖子的真正的标题。


The following example displays the next and previous post titles with arrows to emphasis the direction the user may choose.
下面的例子显示了下一个和上一个帖子标题,用箭头符号来突出用户可以选择的方向。
下面的例子显示了下一个和上一个帖子标题,用箭头符号来突出用户可以选择的方向。
<pre><?php previous_post('&amp;laquo; &amp;laquo; %', '', 'yes'); ?>
| <?php next_post('% &amp;raquo; &amp;raquo; ', '', 'yes'); ?></pre>
<pre><?php previous_post('&amp;laquo; &amp;laquo; %', '', 'yes'); ?>
<pre><?php previous_post('&amp;laquo; &amp;laquo; %', '', 'yes'); ?>
| <?php next_post('% &amp;raquo; &amp;raquo; ', '', 'yes'); ?></pre>
| <?php next_post('% &amp;raquo; &amp;raquo; ', '', 'yes'); ?></pre>


 
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[#WordPress:Other Navigation Locations|&laquo; &laquo; 上一篇帖子标题]]&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;[[#WordPress:Other Navigation Locations|下一篇帖子标题 &raquo; &raquo; ]]</div>
 
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[WordPress:#Other Navigation Locations|&laquo; &laquo; Previous Post Title]]&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;[[WordPress:#Other Navigation Locations|Next Post Title &raquo; &raquo; ]]</div>
 
 
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[WordPress:#Other Navigation Locations|&laquo; &laquo; 上一篇帖子标题]]&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;[[WordPress:#Other Navigation Locations|下一篇帖子标题 &raquo; &raquo; ]]</div>
 
 
To learn more about changing the look of these links, visit the Template Tag page for [[WordPress:Template_Tags/previous_post|previous_post()]] and [[WordPress:Template_Tags/next_post|next_post()]].


学习更多的关于改变这些链接的外观的内容,访问模板标签网页和and [[WordPress:Template_Tags/next_post|下一篇帖子()]]。
学习更多的关于改变这些链接的外观的内容,访问模板标签网页和and [[WordPress:Template_Tags/next_post|下一篇帖子()]]。
== Styling Your Navigation Links ==


== 设计你的导航链接 ==
== 设计你的导航链接 ==
As you have seen, there are a lot of ways WordPress uses to help the user move through a WordPress Site.  We've shown you some of the WordPress template tags, but there are also many [[WordPress:Plugins]] available which also assist with site navigation such as providing ''related posts'', ''customized post lists'', and more to customize your site's navigation.


就如你所看到的那样,WordPress可以使用许多种方法来帮助用户在WordPress站点上导航。我们给你显示了一些WordPress模板标签,但是有许多[[WordPress:Plugins|插件]]可以帮助你站点导航,例如提供''相关的文章'', ''自定义的帖子列表'',和更多的内容来自定义你的站点的导航。
就如你所看到的那样,WordPress可以使用许多种方法来帮助用户在WordPress站点上导航。我们给你显示了一些WordPress模板标签,但是有许多[[WordPress:Plugins|插件]]可以帮助你站点导航,例如提供''相关的文章'', ''自定义的帖子列表'',和更多的内容来自定义你的站点的导航。
The following are some of the resources that may help you in stylizing and customizing your navigation lists.


下面是一些资源可能会帮助你设计和自定义你的导航列表。
下面是一些资源可能会帮助你设计和自定义你的导航列表。
* [[WordPress:Next and Previous Links]]
* [[WordPress:Styling Lists with CSS]]
* [[WordPress:Creating Horizontal Menus]]
* [[WordPress:Dynamic Menu Highlighting]]
* [[WordPress:Plugins/Navigation|Navigation Plugins]]


* [[WordPress:Next and Previous Links|上一个和下一个链接]]
* [[WordPress:Next and Previous Links|上一个和下一个链接]]

2008年4月15日 (二) 10:41的最新版本

当你在工具条和/或者页脚上有一个简明的导航时,人们就可以在你的站点上到处浏览。它帮助人们找到你想要他们阅读的帖子和文章。有许多方法可以帮助用户在你的WordPress站点上友好地导航。

帮助用户使用你的站点意味着将内容放到他们可以找到的位置。在发表的那一天,遵循时事通讯的格式,大多数用户习惯于在一个网页的侧面底部寻找站点内部链接。作为一个设计者,你可以将它们放在任何你希望的位置,但是目前让我们还是遵循传统的位置方法。毕竟,我们希望WordPress站点成为用户友好型的,对吗?

你的WordPress安装带的两个WordPress 主题,都使用一个条框来承载大多数的导航站点链接。其它的主题可能在页眉和页脚上使用导航帮助。虽然这些导航链接可以在任何的模板文件中显示,通常情况下,导航链接包括:

模板标签与产生这个列表的导航链接可以在默认的WordPress工具栏中找到而不是在一个嵌套的列表中找到。让我们个别地看看每个标签,然后看看怎样扩展你的WordPress站点导航设备。

网页[ ]

根据WordPress v1.5的说明,网页能够帮助管理者在WordPress Loop外创建个别的网页,例如联系我们, 关于我们,和什么内容是新的模板标签惯常显示的个人网页是wp_list_网页()

<?php wp_list_pages(); ?>

有许多方式来自定义wp_list_pages()标签使它对你的用户更有用。一个长的网页和子网页的列表,可以运行好一会儿,因此你也许想特写你的条框中最重要的网页。 清除你的列表上的一些网页,你可以将参数设置为清除。下面的例子将网页-ID数字是17和38的网页清除了。

<ul>
<?php wp_list_pages('清除=17,38' ); ?>
</ul>

学习更多的自定义wp_list_pages()模板标签,访问wp_list_网页()的模板标签网页。

类别[ ]

有两个模板标签创建了你的导航菜单的类别列表:wp_list_cats()list_cats()。两个的运行基本相同,但是第一个使用boolean 参数 和 第二个使用strings 你自己决定使用哪个。.

默认的类别列表标签的用法是:

<?php wp_list_cats(); ?>

<?php list_cats(); ?>

同样地,像[[WordPress:#Pages|网页模板标签]],你可以使用exclude来限定你想要列出的类别,用户从几个类别中而不是从二十或者三十个类别中挑选,选起来要更加简单。以下的例子清除了类别-IDs10和15。

<ul>
<?php wp_list_cats('exclude=10, 15'); ?>
</ul>

如果你只想显示你的类别列表中的一个或者更多类别中的孩子 或者 子类别,你可以选择参数的孩子

<ul>
<?php wp_list_cats('child_of=8, 14'); ?>
</ul>

学习更多的自定义这些模板标签的内容,访问关于wp_list_cats()list_cats()的模板标签网页。

归档[ ]

类别模板标签类似,有两个标签产生出以日期为基础的归档列表的链接:wp_get_归档()get_archives()。两个运行基本相同,但是第一个使用boolean 参数 和第二个使用 strings

归档模板标签是没有用一个插件在WordPress中列出文章的唯一的方法。你可以限定你的归档模板标签上的文章数目,但是你不能显示所有的,只能显示一个少数的。然而,标签可以让你显示最近每月,每星期或者每天的文章,或者更近的文章。


归档列表标签的默认的用法是:

<?php wp_get_archives(); ?>

<?php get_archives(); ?>

显示最近三个月中每个月的帖子,你可能要使用下面的:

<ul>
<?php get_archives('monthly','3'); ?>
</ul>

按日期归档,你可以显示最近十五天有价值的文章:

<ul>
<?php wp_get_archives('type=daily&limit=15'); ?>
</ul>


如果你想显示整篇文章,你可以使用参数postbypost,显示最近的文章,由limit参数设置数字。通过文章标题显示最近的25篇文章:

<ul>
<?php wp_get_archives('type=postbypost&limit=25'); ?>
</ul>

学习更多的关于自定义这些模板标签的内容,访问关于得到归档()wp得到归档()的网页。

链接[ ]

链接的链接列表来自WordPress的链接管理功能,允许显示外部链接,例如一个友情链接,用户希望将这个显示在他或者她的站点上的。这些链接是由几个不同的模板标签产生的。

  • 得到链接列表:显示一个链接管理器中定义的,在链接类别标题下分类的,所有链接的一个嵌套的HTML不规则列表。
  • wp_得到链接:显示一个与数字链接类别ID有关的链接。
  • 得到链接: 像wp_get_links()一样,标签允许用户通过标签参数来控制链接的显示,而不是通过管理 > 链接页面来控制链接的显示 (在一个以上的模板上显示链接有用)。
  • wp_通过名称得到链接:显示命名了的链接类别有关的链接。
  • 通过名称得到链接:与wp_通过名称得到链接相似(),这个标签通过类别来显示链接,但是允许用户通过标签参数来控制它们的显示。

关于这些不同的标签,每个的特别的用法的例子和更多的信息,点击以上的标签名。

管理或者 Meta[ ]

WordPress工具条中的管理或者Meta链接列表,是有管理者使用的链接,如果链接了主机,就可以访问站点的管理面板。它们也可能有RSS Feeds和其它的与管理或者站点使用有关的信息。查看以下的标签得到更多的信息,关于你在站点上想使用哪个来帮助你自己和其他的注册的用户:

  • wp_注册() –关于评论或者其它的管理目的,在你的站点上注册
  • wp_退出系统() –使用一个密码,登录和退出你的站点的管理面板。
  • bloginfo() – 可以使用许多的参数来为站点和评论设置RSS/Atomz/RDF feeds。
  • 模板标签 – 在你的站点上使用不同的模板的更多的信息

其它的导航场所[ ]

除了工具条外,你可以帮助你的用户通过使用其它位置的导航标签,在你的站点上导航,例如在你的站点的页眉页脚上的导航标签。为导航链接使用以上的模板标签,你可以将链接列表设计为横向菜单而不是垂直的列表。

导向文章和网页的链接[ ]

在这些狭隘的区域里,通常,你只想要突出特别的文章或者网页来保存空间或者将用户引导到特别的区域,使他们继续浏览。使一个帖子或者一个网页包含一个特别的链接,你可以使用得到_permalink()模板标签。


下面的例子显示了对于帖子-ID数字1和10的链接,并且链接了站点上的类别,除了类别-ID2和4。


<li><a href="<?php echo get_permalink(1); ?>">About My Blog</a></li>
<li><a href="<?php echo get_permalink(10); ?>">About Me</a></li>
<?php wp_list_cats('exclude=2, 4'); ?>

链接可能看起来像:

上一篇和下一篇帖子[ ]

当你设计你的站点的时候,需要考虑另外两套导航设备。这两套设置都涉及到将你的站点上的用户从一个帖子导航到另一个帖子。

第一套导航设备只出现在非单一的/非-permalink网页上,而且是模板标签posts_nav_link()。这个标签在WordPress Loop里的网页底部创建了两个链接,来显示索引,归档,搜索,和类别的上一个下一个网页。

默认情况下,posts_nav_link看起来像这样:

学习更多的关于改变这个链接的外观的内容,访问模板标签网页得到posts_nav_link()。 另一套导航设备用来在你的站点上移动,来控制通常在你的单一的/permalink帖子底部出现的下一个帖子上一个帖子。这些能引导用户来到按时间顺序创建的上一个或者下一个帖子。 模板标签是上一篇帖子()下一篇帖子()。这些可以以几种不同的方式来设计,使用下一个帖子上一个帖子标题或者使用使用上一个和下一个帖子的真正的标题。

下面的例子显示了下一个和上一个帖子标题,用箭头符号来突出用户可以选择的方向。

<?php previous_post('&laquo; &laquo; %', '', 'yes'); ?>
| <?php next_post('% &raquo; &raquo; ', '', 'yes'); ?>

学习更多的关于改变这些链接的外观的内容,访问模板标签网页和and 下一篇帖子()

设计你的导航链接[ ]

就如你所看到的那样,WordPress可以使用许多种方法来帮助用户在WordPress站点上导航。我们给你显示了一些WordPress模板标签,但是有许多插件可以帮助你站点导航,例如提供相关的文章, 自定义的帖子列表,和更多的内容来自定义你的站点的导航。

下面是一些资源可能会帮助你设计和自定义你的导航列表。