简体   繁体   English

我如何在页面模板上应用管理CSS

[英]How can i apply admin css on a page template

I am trying to show pods ui on front end which it now has been updated to do so however my porblem is its still using the old admin css from wordpress. 我试图在前端显示pod ui,现在对此进行了更新,但是我的问题是仍然使用wordpress的旧admin css。 So my questions is how do i load admin styles in a page template like the following. 所以我的问题是我如何在页面模板中加载管理样式,如下所示。 Its missing the styles like wide fat etc 它缺少像宽胖等样式

<?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();
?>

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. 您正在运行wp_head和wp_footer动作(它们在get_header / footer()内),而不是它们的管理员同级admin_header和admin_footer。

Try adding do_action( 'admin_header' ); 尝试添加do_action( 'admin_header' ); to the header and do_action( 'admin_footer' ); 到标题和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. 另外,您应该将整个内容包装在权限检查中,如果失败,则应重定向到登录名或home。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM