Home  >  Article  >  CMS Tutorial  >  Teach you how to modify the number of custom columns displayed in WordPress

Teach you how to modify the number of custom columns displayed in WordPress

藏色散人
藏色散人forward
2020-11-19 15:30:012334browse

The following WordPress Tutorial column will introduce to you how to modify the number of custom columns displayed in WordPress. I hope it will be helpful to you. Friends in need help!

Teach you how to modify the number of custom columns displayed in WordPress

Sometimes we will select the added custom column name in the Add Custom Column panel, but WordPress only displays the first 30 custom column names in alphabetical order by default , the excess will not be displayed. When there are too many custom columns added, the custom columns you want to add will not be found in the selection box. You can only add them manually, which is very inconvenient. You can increase the number of displays through the following code.

Add the following code to the current theme function template functions.php.

add_filter( 'postmeta_form_limit' , 'customfield_limit_increase' );
function customfield_limit_increase( $limit ) {
$limit = 100;
return $limit;
}

The number 100 is the displayed number and can be adjusted appropriately.

The above is the detailed content of Teach you how to modify the number of custom columns displayed in WordPress. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zmingcx.com. If there is any infringement, please contact admin@php.cn delete