2017-05-18 9 views
0

私はショートがページに配置しますが、それは例えば、うまく設計、実装フォーム を返します、ショートを使用しての機能を持っている1つのプラグインを作っています:https://www.screencast.com/t/XTteV6u8qwロード特定のCSSファイル - ワードプレス

今、私が追加した場合bootstrap css/classes私の現在のテーマが台無しになった

私のショートコード機能の表示デザインは同じテーマのような機能を望みます。 どうすれば可能ですか?

これに関する情報は非常に高く評価されます。ありがとう!

+0

この1すべては...あなたを助けるhttps://wordpress.stackexchange.com/questions/165754/enqueue-scripts-styles-when-shortcode-is-present –

答えて

2

次の例のように、そのショートコードコンテンツの内部CSSを記述することができます。

function shortcode_func($atts) { 

    $returnString = '<style>'; 
    $returnString .='#shortcode-id{background-color:yello;}'; 
    $returnString .= '</style>'; 

    $returnString .='<div id="shortcode-id"></div>'; 
    return $returnString; 
} 

add_shortcode('shortcode-name', 'shortcode_func');

関連する問題