Help us understand the problem. What is going on with this article?

Wordpressの管理画面にオリジナルのCSS・JavaScriptを適用させる

フォルダ構成

qiita.png

必要な記述

functions.php
<?php
/**
 * エディタースタイル適用
 * */

    add_editor_style(get_template_directory_uri()."/css/admin/editor-style.css");

/**
 * 管理画面スタイル適用
 * */

function my_admin_stylesheet()
{
    wp_enqueue_style('custom-admin-style', get_stylesheet_directory_uri().'/css/admin/admin-style.css');
    wp_enqueue_script('admin-script', get_stylesheet_directory_uri() . '/js/admin/admin-style.js', array(), '1.0.0', true);
}
add_action('admin_enqueue_scripts', 'my_admin_stylesheet');

/**
 * 管理画面にもfaviconをつける
 * */
function admin_favicon()
{
    echo '<link rel="shortcut icon" type="image/x-icon" href="'.get_stylesheet_directory_uri().'/img/favicon.ico" />';
}
add_action('admin_head', 'admin_favicon');

/**
 * ログイン画面CSS変更
* */

function my_login_stylesheet()
{
    wp_enqueue_style('custom-login', get_stylesheet_directory_uri().'/css/admin/login-style.css');
}
add_action('login_enqueue_scripts', 'my_login_stylesheet');
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした