我正在尝试在前端显示pods ui,它现在已经更新了,但是我的问题仍然是它仍在使用来自wordpress的旧管理员css。所以我的问题是如何在页面模板中加载管理样式,如下所示。它缺少广泛的脂肪等风格
<?php
/**
* Template Name: Goals Managment
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
get_header();
$object = pods( 'goals' );
$add_fields = $edit_fields = array(
'title',
'points',
'foundation_payout',
'kids_payout',
'total_payout',
);
$object->ui = array(
'title' => 'goals',
'columns' => array(
'title' => 'Title',
'points' => 'Points',
'foundation_payout' => 'Foundation Payout',
'total_payout' => 'Total Payout'
),
'add_fields' => $add_fields,
'edit_fields' => $edit_fields
);
pods_ui_manage($object);
get_footer();
?>
答案 0 :(得分:0)
You are running the wp_head and wp_footer actions (they are inside get_header/footer() ) but not their admin siblings admin_header and admin_footer.
Try adding do_action( 'admin_header' );
to the header and do_action( 'admin_footer' );
to the footer. Also, you should wrap this whole thing in a permissions check and redirect to login or home if it fails.