简体   繁体   中英

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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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