How create a Shortcode with hover and complex options

Gradient and boxshadow are fine to put inline. Your trouble will be with the hover states. Luckily there is a trick. You can put the hover styles in an outer element and force inherit on hover. Like this: <div class=”myshortcode”> <a style=”color:blue;”><span style=”color:red;”>Content</span></a> </div> In your style.css you add this generic line with a transition … Read more

Different post styles depending on category

If your theme has body_class() in the body tag (normally in header.php) then the category name is added to the body tag as a class e.g. <body class=”my-category”> So in a css file you can do .my-category #my-element { background:#FF0000; } To edit the html for the categories to make them card layouts then you … Read more

How does wp_enqueue_scripts work?

Thanks for rewriting the question: It seems much clearer now. Sorry for the protracted comments earlier, but I wasnt on my laptop. I corrected a couple of typos in your code and pasted this into my functions.php: // include files via shortcode function include_file($atts) { extract(shortcode_atts(array(‘filepath’ => NULL), $atts)); if ($filepath!=’NULL’ && file_exists( trailingslashit( get_stylesheet_directory() … Read more

Background-image not showing? [closed]

We lack context, but remember that CSS files are read from top to bottom, the lower definitions having priority over the top ones. The same logic applies within the file. That is why the !important attribute is used for. That being said, in your case you could have A caching plugin that loads a cached … Read more