wordpress分类列表页只显示标题和摘要问题比如说我创建了一
首先,到wordpress后台,依次选择?外观-->编辑-->选择右边的index.php文件,在里面可以看到语句 其次可以看出,index.php是嵌套一个?content.php?的文件用于专门显示文章的内容,这就是为什么在首页老是显示文章全文。
那么,打开content.php文件找到 →',?'twentyeleven'?)?);? ?> 将它修改为 最后,保存,就显示摘要了。
知更鸟wordpress主题摘要字数控制文件
WordPress获取指定的摘要指数可以参考一下以下代码: post_excerpt) { $excerpt = $post->post_excerpt; } else { if(preg_match('/(.*)/iU',trim(strip_tags($post->post_content,"")),$result)){ $post_content = $result['1']; } else { $post_content_r = explode("\n",trim(strip_tags($post->post_content))); $post_content = $post_content_r['0']; } $excerpt = preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,0}'.'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s','$1',$post_content); } return str_replace(array("\r\n", "\r", "\n"), "", $excerpt); }}?>代码来源于泪雪博客:网页链接 版权归原作者所有...
如何将Wordpress默认主题twentytwelve中首页文章摘要标题下的“回...
进入管理后台,点击左侧菜单“设置”--“讨论”2在右侧页面“默认文章设置”里去掉“允许他人在新文章上发表评论 ”前的勾关闭某篇文章的评论1进入到管理后台,点击“所有文章”,将鼠标移至想要编辑文章下方,就会出现一个菜单,点击“快速编辑”2去掉右侧“允许评论”前的勾,然后保存,该篇文章就不能进行评论了。
wordpress怎么关掉 杂志单栏小工具
wordpress为了方便管理员快速的从前台进入后台来管理网站在wordpress顶部强制加入了一个工具条(adminbar),而且默认是对所有用户都显示的,有时候看着挺烦心。
那么怎么来去除这个烦人的工具条(adminbar)呢?一、完全禁用工具条:1、完全去除wordpress工具条(代码一)show_admin_bar(false);完全去除wordpress工具条(代码二)add_filter('show_admin_bar','__return_false');2、只对特定用户显示工具条只对管理员显示if(!current_user_can('manage_options')){add_filter('show_admin_bar','__return_false');}只对管理员和编辑显示if(!current_user_can('edit_posts')){add_filter('show_admin_bar','__return_false');}3、将工具条从顶部移至页脚functionfb_move_admin_bar(){echo'body{margin-top:-28px;padding-bottom:28px;}body.admin-bar#wphead{padding-top:0;}body.admin-bar#footer{padding-bottom:28px;}#wpadminbar{top:auto!important;bottom:0;}#wpadminbar.quicklinks.menupopul{bottom:28px;}';}//如果你想让工具条显示在后台顶部,请删除这行代码add_action('admin_head','fb_move_admin_bar');//如果你想让工具条显示在前台顶部,请删除这行代码add_action('wp_head','fb_move_admin_bar');以上代码都是加入到functions.php中即可。
wordpress关闭评论之后,”评论已关闭“这几个字怎么删除
functions.php文件中加入一段代码即可//关闭搜索if(!is_admin()){function fb_filter_query( $query, $error = true ) {if ( is_search() ) {$query->is_search = false;$query->query_vars[s] = false;$query->query[s] = false;if ( $error == true )$query->is_404 = true;}}add_action( 'parse_query', 'fb_filter_query' );add_filter( 'get_search_form', create_function( '$a', "return null;" ) );}
转载请注明出处51数据库 » wordpress 关闭摘要
锄禾ing