2017-01-21 16 views
1

私は子供のテーマを作成しますが、私はそれを私のメインメニューで変更しないスタイルを追加したいと思います。働くWordpressの子供のテーマを作成する方法

私はfunction.phpでは、2つのファイルのstyle.cssとfunction.php を作成し、このフォルダに

\public_html\wp-content\themes 

方向にaloshop-子フォルダを作成し、私はコードを追加しました:

<?php 

function aloshop_child_enqueue_styles() { 

$parent_style = 'aloshop'; 

wp_enqueue_style($parent_style, get_template_directory_uri() . '/style.css'); 
wp_enqueue_style('aloshop', 
get_stylesheet_directory_uri() . '/style.css', 
array($parent_style) 
); 
} 
add_action('wp_enqueue_scripts', 'aloshop_child_enqueue_styles'); 

とstyle.cssで単純な情報を追加するだけです。

/* 
Theme Name: Aloshop child theme 
Author: Mantas Slau 
Description: A child theme of the Aloshop default WordPress theme 
Version: 1.1 
Template:  aloshop 
*/ 

次は何ですかidはダッシュボードでこの子テーマを有効にしました。

私はこの子のテーマが機能するかどうかを確認しようとしました。私は私の視覚的な作曲家のカスタムCSSコード(私は私のページを開発した私は一時的に追加された)から切り取り、それを子テーマ - > `style.cssに貼り付けます。

/* 
    Theme Name: Aloshop child theme 
    Author: Mantas Slau 
    Description: A child theme of the Aloshop default WordPress theme 
    Version: 1.1 
    Template:  aloshop 
    */ 

    .footer-box h2 { 
     font-size: 14px; 
     font-weight: 700; 
     margin: 0 0 13px; 
     text-transform: uppercase; 
     color: #fe9c00; 
    } 
    .menu-footer a { 
     border-left: 1px solid #dadada; 
     display: block; 
     height: 14px; 
     line-height: 14px; 
     padding: 0 13px; 
     color: white; 
    } 
    .footer-box p { 
     color: white; 
    } 
    .footer-menu-box-end a { 
     color: white; 
     font-size: 14px; 
     padding-left: 10px; 
     position: relative; 
    } 
    .footer-menu-box-end a:hover{ 
     color: #fe9c00; 
    } 
    .footer-menu-box-end h2 { 
     font-size: 14px; 
     font-weight: 700; 
     margin: 0 0 13px; 
     text-transform: uppercase; 
     color: #fe9c00; 
    } 
    .footer-box-contact a { 
     color: white; 
    } 
    .social-footer li:first-child a{ 
     margin-left:10; 
    } 
    .social-footer.social-network label { 
     margin: 0 0 10px; 
     color: #fe9c00; 
    } 
    .category-home-label span { 
     color: #fff; 
     font-size: 12px; 
     font-weight: 700; 
     margin: 0; 
     text-transform: uppercase; 
     vertical-align: middle; 
    } 
    ul { 
     padding: 0; 
     list-style: none; 
    } 
    .sub-menu-top { 
     width: 200px; 
    } 
    .list-child-category { 
     min-height: 155px; 
    } 
    .woocommerce div.product .product_title { 
     font-size: 25px; 
     font-weight: 700; 
     margin: 0 0 13px; 
     text-transform: uppercase; 
    } 
    .price span { 
     font-size: 25px; 
     font-weight: 700; 
     margin: 0 0 13px; 
     text-transform: uppercase; 
     color: #fe9c00; 
    } 
    .woocommerce div.product div.images img { 
     /* display: block; */ 
     /* width: 100%; */ 
     /* height: auto; */ 
     /* box-shadow: none; */ 
     width: 350px; 
     padding: 1px; 
     border: 1px solid #e0e0d1; 
     background-color: #e0e0d1; 
    } 

スタイルコードですが意味がありません。

保存--->リフレッシュとスタイルが機能しません。 誰かがこの問題を助けることができますか?何が間違っていますか?事前に感謝

答えて

0

wp_enqueue_style('aloshop-child',get_stylesheet_directory_uri() . '/style.css',array($parent_style)); 
0

私は解決策を見つける。私のブラウザはクッキーを作成します。リフレッシュする前にCtrl + F5を押すと、ブラウザがクリアされます。私のコードは良いです。代わりにstyle.cssファイルを呼び出すための "aloshop-子"

wp_enqueue_style('aloshop',get_stylesheet_directory_uri() . '/style.css',array($parent_style)); 

を "aloshop" 使用のfunction.phpファイルで

関連する問題