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

【wordpress】【css】【PHP】cssが更新されないor読み込まれない

メモです

CSSの読み込みはどこに書く?WordPress公式マニュアルに書かれている正しい手順。

以下、追加

functions.php

function add_css_js() {//関数名add_css_js()を作成
    //CSSの読み込みはここから

    //全てのページにstyle.cssを読み込み
  wp_enqueue_style('style',get_template_directory_uri().'/style.css','',date('YmdGi', filemtime( get_template_directory().'/style.css' )),'' );

    //全てのページにcss/store.cssを読み込み
    wp_enqueue_style('store', get_template_directory_uri().'/css/store.css');

    //固定ページスラッグcontact か 投稿ID46の記事 か カスタム投稿タイプadd_newsの記事 か カスタム投稿タイプadd_newsの一覧だった場合、css/store2.cssを読み込み
    if (is_page('contact')||is_single(46) || is_singular('add_news') || is_post_type_archive('add_news')) {
        wp_enqueue_style('store2', get_template_directory_uri().'/css/store2.css');
    }

    //JavaScriptの読み込みはここから

    //全てのページにjs/pagetop.jsを読み込み
    wp_enqueue_script('pagetop', get_template_directory_uri().'/js/pagetop.js');

    //トップページのみ
    if (is_home()) {

    //js/main.jsをfooter直下で読み込み  
        wp_enqueue_script('main', get_template_directory_uri().'/js/main.js', array( 'jquery' ), '', true); 
    }
}
//関数名add_scripts()を表側で呼び出す
add_action('wp_enqueue_scripts', 'add_css_js);

vanana
24才エンジニアです。 自分のレベル感です。↓ http://petkeeperapp.herokuapp.com/login 参考程度に、、
http://petkeeperapp.herokuapp.com/login
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
ユーザーは見つかりませんでした