2017-05-17 5 views
0

wordpressで動作するウェブサイトで作業したい。 Wordpressコミュニティで提案されているように、私は子供のテーマを作成し、それにコードを書く必要があります。したがって、2つのCSSファイルがあります.1つのCSSファイルは親テーマのもので、他のものは子テーマのものです。だから、エンドユーザがリクエストすると、2つのcssファイルリクエストがありますか?Wordpress:Childテーマの開発により、ブラウザからの2つのCSSリクエストが発生する

+1

ようこそ。最初に[HELP center](http://stackoverflow.com/help)に進み、[GET started](https://meta.stackoverflow.com/questions/252149/how-does-a-new-user)にアクセスしてください。最後に、[質問する方法](http://stackoverflow.com/help/how-to-ask)を読んで、[MCVE:Minimal、Complete、and-get-started-on-stack-overflow検証可能な例](http://stackoverflow.com/help/mcve)を参照してください。専用の[SE wordpress community](https://wordpress.stackexchange.com/)の使用を検討することもできます。 – OldPadawan

答えて

0

あなたがすることができますしたい場合、それだ3つのファイル

1. functions.php 

<?php 
// 
// Recommended way to include parent theme styles. 
// (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme) 
// 
add_action('wp_enqueue_scripts', 'theme_enqueue_styles'); 
function theme_enqueue_styles() { 
    wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); 
    wp_enqueue_style('child-style', 
     get_stylesheet_directory_uri() . '/style.css', 
     array('parent-style') 
    ); 
} 
// 
// Your code goes below 
// 

2. rtl.php 

/* 
Theme Name:  Theme-x Child 
Template:  

Right to Left text support. 
*/ 
@import url("../Theme-x/rtl.css"); 

3.style 

/* 
Theme Name:  Theme-x Child 
Description: wordpress 
Author:   admin 
Template:  Theme-x Child 

(optional values you can add: Theme URI, Author URI, Version, License, License URI, Tags, Text Domain) 
*/ 

を作成したフォルダ内の自分のテーマ名は、名前のテーマ-X-子とフォルダをテーマ-X

を作成している

を仮定screenshot.pngも追加してください。それはあなたの親のテーマからスタイルを取得します。

関連する問題