Andy_R
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Hi Marko,
Yes the issue is gone if the code is changed.
Database caching via Redis is currently enabled.
Thanks
Forum: Fixing WordPress
In reply to: Adding column to pages page with page template nameTry this:
function my_custom_pages_columns( $columns ) { $myCustomColumns = array( 'template' => __( 'Template') ); $columns = array_merge( $columns, $myCustomColumns ); return $columns; } function custom_admin_css() { echo '<style type="text/css"> td.column-template { width: 150px; } th.column-template { width: 150px; } </style> '; } function custom_page_column_content( $column_name, $post_id ) { if ( $column_name == 'template' ) { $page_template = get_field( '_wp_page_template' ); if ( $page_template) { $page_template = str_replace ( "default" , " " , $page_template ); $page_template = str_replace ( "template-" , "(" , $page_template ); $page_template = str_replace ( ".php" , ")" , $page_template ); echo $page_template; } } } add_action('admin_head', 'custom_admin_css'); add_filter( 'manage_pages_columns', 'my_custom_pages_columns' ); add_action( 'manage_pages_custom_column', 'custom_page_column_content', 10, 2 );The only thing is the get_field() call may not work with custom fields, I don’t know.
Viewing 2 replies - 1 through 2 (of 2 total)