wordpress 使用中遇到的种种问题

WP-PageNavi 让首页有翻页栏

在主题文件夹中的index.php中插入

<CENTER><?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi(); } ?></CENTER> <br>

================================================

2. 让首页显示摘要

在index.php中找到the_content();替换成下边的代码

<?php
if(!is_single()) {
the_excerpt();
} else
the_content(__(‘Read the rest of this entry &raquo;’, ‘auroral’));
}
?>

或安装插件:Limit Posts

激活后

把the_content()换成the_content_limit(”,TRUE,”,555);

============================================

WP居然不支持RAR的上传

修改 wp-includes/functions.php

找到 function get_allowed_mime_types() {

在下面的if ( !$mimes ) {

下面增加一个

‘rar’ => ‘application/rar’

===========================================

将 LBS 或 PJBlog 转为wordpress(支持的最新的 LBS和PJBlog 2.7 及以下的版本)

* 将 LBS 或 PJBlog 的数据库改名为 blog.mdb
* 将 asp2wp.asp 以及 blog.mdb 上传到同一 ASP 空间目录下
* 运行程序根据需求点击相应的按钮获取 xml 格式的导出数据
* 进入已安装好的 WordPress 后台依次打开“管理”->“导入”->“WordPress”,根据提示导入之前获取的 xml 格式数据文件

提示:如果数据文件比较大,可以使用压缩包内所提供的 XML 分割软件分割成多个小尺寸数据文件依次导入。

asp2wp

================================================

改变归档样式

按月显示最近12个月的文章存档列表

<?php wp_get_archives(‘type=monthly&limit=12’); ?>

最近十五天的文章存档

按日期显示最近十五天的文章存档

<?php wp_get_archives(‘type=daily&limit=15’); ?>

最近二十篇文章存档

按文章标题为顺序,显示最近二十篇文章的存档列表。

<?php wp_get_archives(‘type=postbypost&limit=20&format=custom’); ?>

下拉式菜单

以下拉式菜单形式显示月份文章存档,在<select>标签中,显示文章总数。

<select name=”archive-dropdown” onChange=’document.location.href=this.options[this.selectedIndex].value;’>
<option value=””><?php echo attribute_escape(__(‘Select Month’)); ?></option>
<?php wp_get_archives(‘type=monthly&format=option&show_post_count=1’); ?> </select>

把使用的主题里边的sidebar.php中的
<?php wp_list_pages(‘title_li=<h2>’ . __(‘Pages’, ‘auroral’) . ‘</h2>’ ); ?>

<li><h2><?php _e(‘Archives’, ‘auroral’); ?></h2>
<ul>
<?php wp_get_archives(‘type=monthly’); ?>
</ul>
</li>

改为

<?php wp_list_pages(‘title_li=<h2>’ . __(‘Pages’, ‘auroral’) . ‘</h2>’ ); ?>

<li><h2><?php _e(‘Archives’, ‘auroral’); ?></h2>
<ul>
<select name=”archive-dropdown” onChange=’document.location.href=this.options[this.selectedIndex].value;’>
<option value=””><?php echo attribute_escape(__(‘Select Month’)); ?></option>
<?php wp_get_archives(‘type=monthly&format=option&show_post_count=1’); ?> </select>
</ul>
</li>



发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注