站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Adding Asides
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
== 在工具条上显示Asides== [[WordPress:Image:asides-in-sidebar.jpg|right|frame|Asides on the Sidebar at noscope.com]]'''REMEMBER''': The following section has nothing to do with Matt's asides. They are INDEPENDENT of each other and will not work with each other. [[WordPress:Image:asides-in-sidebar.jpg|right|frame| noscope.com中的工具条上的Asides]]'''REMEMBER''':下面的部分与Matt的asides没有任何关系,它们是互相独立的,而且不会在一起运行。 There are times when you want to display your Asides in your sidebar. In the <tt>sidebar.php</tt> template file of your WordPress Theme, add the following where you wish the asides to appear. If you want them outside of the list, make sure to position this above or below the Unordered List (<tt><ul></tt>) tags or within them as a List Item (<tt><li></tt>): 有时候,你想要在工具条内显示Asides。在WordPress主题的<tt>sidebar.php</tt>模板文件中,将下面的内容添加到你希望asides显示的位置。如果你希望asides出现在列表之外,确定将下面的内容放到无序列表(<tt><ul></tt>)标签的上面或者下面或者放到无序列表标签的内部作为列表内容(<tt><li></tt>): <pre><?php if ($posts) : foreach ($posts as $post) : the_post(); ?> <?php if (in_category(14)) { ?> <div class="asides_sidebar"> <?php echo $post->post_excerpt ?> <?php the_content(); ?> <small><?php comments_popup_link(__('#'), __('(1)'), __('(%)')); ?> <?php edit_post_link('Edit', ' — '); ?></small> </div> <?php } ?> <?php endforeach; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?></pre> <pre><?php if ($posts) : foreach ($posts as $post) : the_post(); ?> <?php if (in_category(14)) { ?> <div class="asides_sidebar"> <?php echo $post->post_excerpt ?> <?php the_content(); ?> <small><?php comments_popup_link(__('#'), __('(1)'), __('(%)')); ?> <?php edit_post_link('Edit', ' — '); ?></small> </div> <?php } ?> <?php endforeach; else: ?> <p><?php _e('对不起,没有文章符合你的标准。'); ?></p> <?php endif; ?></pre> Now, you can style the CSS for the <tt>div</tt> "<tt>asides_sidebar</tt>" to your liking in the <tt>style.css</tt> style sheet. 现在你可以在<tt>style.css</tt>样式表上,根据你的爱好,为<tt>div</tt> "<tt>asides_sidebar</tt>"设计CSS。 With Asides in the sidebar, you may want to disable them from being displayed within the main loop. This can be easily done with a snippet of code within the loop. Asides在工具条中,你可能想要阻止Asides在主要的loop内部显示。在loop内放一些代码,做到这一点,就很容易。 Find this line within the loop in your main <tt>index.php</tt> file: 在你的主要的<tt>index.php</tt>文件中的loop内找到这一行: <pre><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?></pre> <pre><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?></pre> Just after that line, paste this line (change the 14 to your category ID number): 在那一行的后面,粘贴这一行(将14更改为你的类别ID数): <pre><?php if (in_category('14') && is_home() ) continue; ?></pre> <pre><?php if (in_category('14') && is_home() ) continue; ?></pre> After that, you will then need to find this line: 然后,你需要这个命令行: <pre><?php endwhile; ?></pre> <pre><?php endwhile; ?></pre> And just before that line, paste this: 在那一行的前面,粘贴上这个: <pre><?php } ?></pre> <pre><?php } ?></pre> After doing all of that, you will need to put this line: 做好之后,你需要放入这一行: <pre><?php rewind_posts(); ?></pre> <pre><?php rewind_posts(); ?></pre> Either before the loop in your <tt>index.php</tt> file or before the loop in your <tt>sidebar.php</tt> file, depending on which one comes last. So, for example, if <tt><?php get_sidebar(); ?></tt> comes after the <tt><?php endif; ?></tt> line in <tt>index.php</tt>, then you will have to put it before the loop in <tt>sidebar.php</tt>. 在<tt>index.php</tt>文件的loop之前或者在<tt>sidebar.php</tt>文件的loop之前,取决于哪个速度更快。例如,如果<tt><?php get_sidebar(); ?></tt>在<tt>index.php</tt>中的<tt><?php endif; ?></tt>命令行之后,你需要将它放在<tt>sidebar.php</tt>中的loop中。 Voila. Asides will now be displayed on the sidebar, rather than within the loop, giving it a more 'linkblog' feel. 就是,Aside现在会显示在工具条中而不是loop内,使得其更有'链接博客'的特性。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)