Reputation: 941
I am making one plugin which has functionality using shortcode , While shortcode will place in the page , it will return a well desgin form For example : https://www.screencast.com/t/XTteV6u8qw
Now if I add bootstrap css/classes my current theme went messed up,
I want functionality like in any theme my shortcode function display design will remain same. Any idea about how it is possible ?
Any information on this would be greatly appreciated. Thanks!
Upvotes: 0
Views: 596
Reputation: 122
You could write the internal css of that shortcode content like below example.
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' );
Upvotes: 1