我还想修改页面列表中可见页面的数量,现在是20页。
解决方案:
function wpd_change_page_labels( $labels ) {
$labels->search_items = \'put the new name\';
return $labels;
}
add_filter( \'post_type_labels_page\', \'wpd_change_page_labels\' );
我还想修改页面列表中可见页面的数量,现在是20页。
解决方案:
function wpd_change_page_labels( $labels ) {
$labels->search_items = \'put the new name\';
return $labels;
}
add_filter( \'post_type_labels_page\', \'wpd_change_page_labels\' );
To change Number of items per page in Screen Options, 将此代码添加到functions.php
您的主题:
function wpse_modify_screen_option() {
$number_of_items = 10; // change this to desired value
$screen = get_current_screen();
if ( $screen->id != \'edit-page\' )
return;
$user_id = get_current_user_id();
if ( $user_id ) {
update_user_meta( $user_id, \'edit_page_per_page\', $number_of_items );
}
}
function wpse_screen_option() {
add_action( \'load-edit.php\', \'wpse_modify_screen_option\' );
}
add_action( \'admin_menu\', \'wpse_screen_option\' );
这将更改所有用户在屏幕选项中每页的项目数。如果要仅对选定用户执行此操作,请替换该行:update_user_meta( $user_id, \'edit_page_per_page\', $number_of_items );
使用$users = array( id1,...,idn, ); // replace id1 to idn with user ids
if ( in_array( $user_id, $users ) )
update_user_meta( $user_id, \'edit_page_per_page\', $number_of_items );
To change the search pages label and remove the numbers of items, 制作以下脚本(wpse\\u search\\u button.js)并将其添加到主题的根目录中:// JavaScript Document
jQuery( document ).ready(function($) {
$(\'.displaying-num\').css( \'display\', \'none\' );
$(\'#search-submit\').val( \'Look for Pages\' );
});
现在将此添加到functions.php
:function wpse_load_admin_js() {
global $pagenow, $typenow;
if ( $pagenow == \'edit.php\' && $typenow == \'page\' ) {
wp_register_script( \'wpse-search-button-js\', get_stylesheet_directory_uri() . \'/wpse_search_button.js\', array( \'jquery\' ), false, true );
wp_enqueue_script( \'wpse-search-button-js\' );
}
}
add_action( \'admin_init\', \'wpse_load_admin_js\' );
这将隐藏项目数,并将“搜索页面”按钮标签更改为“查找页面”。我的新网站上有一个关于wordpress的主要问题。每当我上传新媒体时,它的附件页都会给我一个404。我的permalink结构如下:baseurl + /%category%/%year%/%monthnum%/%day%/%postname%/我有数百种媒体(从旧网站导入),它们都给出了404。我可以直接访问媒体,但不能访问附件页。有一个附件。php提供了这个主题,我知道它可以工作,因为我的旧网站使用了相同的主题。知道怎么做吗?