我正在创建一个使用短代码功能的插件,而短代码将放在页面中,它将返回一个良好的设计形式 例如:https://www.screencast.com/t/XTteV6u8qw
现在,如果我添加bootstrap css / classes,我当前的主题就搞砸了,
我想要任何主题的功能我的短代码功能显示设计将保持不变。 知道怎么可能吗?
有关此的任何信息将不胜感激。谢谢!
答案 0 :(得分:1)
您可以编写该短代码内容的内部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' );