Adding inline styles from a widget

Got it. So here’s how you insert a hover state halfway the processing of a page without violating the w3c rules. This is the code you don’t want your widget to produce: <div class=”mywidget”> <style>.mywidget a {color:red}, . mywidget a:hover {color:blue;}</style> <a>Link</a> </div> The following validates and is fairly elegant. In your widget generate the … Read more

Excluding categories from “Manage Categories” using a get_terms filter

I think you should use get_terms_args filter instead of get_terms and just add exclude arg, so now get_terms() function won’t retrieve those cats and you’ll get right count. Here’s code example: add_filter( ‘get_terms_args’, ‘mamaduka_edit_get_terms_args’, 10, 2 ); /** * Exclude categories from “Edit Categories” screen * */ function mamaduka_edit_get_terms_args( $args, $taxonomies ) { if ( … Read more

Creating Page Based on Category

REVISIT: Feb. 2nd 2016 The original code had many issues Data wasn’t sanitized and validated which can lead to serious security issues Some parts were repetitive Bit messy and sometimes hard to read Some sections was only partly working Used globals which is really evil That is why I revisited this answer and updated the … Read more