WordPress文章列表默认用the_excerpt()函数直接输出post的摘要内容,但是这个函数没有入参,the_excerpt()的输出长度是确定的55字符。
WordPress搬家写入权限问题
WordPress遇到以下问题时: 1. 不能上传图片 2. 不能自动安装主题、插件(需要FTP账户) 3. 不能自动更新 4. 其它任何需要wordpress写文件的操作失败 由于WordPress目录不属于当前的用户和组,即web访问的用户没有权限操作WordPress的一切需 ...
WordPress IP验证不当漏洞的解决办法
首先找到路径文件/data/wwwroot/www.domain.com/wp-includes/http.php,然后修改两处代码:
WordPress时间轴页面简易模板
CSS样式(可添加在WordPress主题样式表) /* 站点动态时间轴 */ #teamnewslist ol{list-style:none;margin-left: 36px;padding-left: 14px;border-left: 2px solid #eee;font-size: 18px;color: #666;} #teamnewslist b{font-size: 12px;font-weight ...
WordPress导航菜单添加一个搜索框
主题functions.php文件添加代码。 add_filter('wp_nav_menu_items','add_search_box', 10, 2); function add_search_box($items, $args) { ob_start(); get_search_form(); $searchform = ob_get_contents(); ob_end_clean(); $items .= '<l ...
WordPress安装完成后优化精要
文件修改 1. WordPress后台 后台-Media取消按照年/月/的目录结构保存文件,取消缩略图,调整缩略图尺寸为0,然后修改固定链接。 2. 根目录.htaccess Options All -Indexes RedirectMatch 301 /apple-touch-icon(.*)?.png http://example.com ...