If you work long hours at a computer, adjusting the brightness of the screen is a must to avoid eye strain and headaches. Especially during the winter when there is less natural light in the work space, continuous exposure to bright monitors can be a real problem. A solution, of course, is to lower the …
How To Specify Top Level Selectors Within Mixins With LESSphp
While creating mixins for cool snippets of reusable css, I had trouble figuring out a way to set styles for top level elements while inside a mixin. To illustrate, let’s look at this example from CSS tricks which uses pseudo elements to create a bar that breaks out a container to touch both sides of …
Here’s How To Improve (Social) Psychology’s Academic Reputation
The social sciences such as psychology and sociology have been getting hammered as questions arise over the validity of findings coming out of various studies. The most heinous of causes are incidences of fraud, which is a terrible blow to the field any time it happens, but it goes beyond even that. Research methods are …
Fear And Surprise: Improving A Widespread WordPress Pattern
A very common pattern used in WordPress core, plugins and themes is way of dealing with supplying arguments to functions and merging them with default values. This pattern is documented in the codex here and utilizes wp_parse_args() and extract(). What does it do? Well a look at the actual wp_parse_args function shows us that it’s …
Organizing Your WordPress Theme’s CSS
Stylesheet files can get ridiculously long. The Twenty Eleven theme has over 2500 lines of css (unminified). That can be a pain if you’re trying to make significant adjustments to a theme. Quite a few theme frameworks take a more modular approach to css and separate their CSS into different files. That is a big improvement, …
Troubleshooting Auto-Formatting Issues In WordPress
Got a bunch of white lines in your post that you are sure you didn’t put there yourself? Is your content getting wrapped in paragraphs in all the wrong places? Are shortcodes messing up your text or coming all out of whack? Welcome to auto-formatting hell. Let’s troubleshoot this. WordPress allows your content to have …
Three Great Browsers Not Named Chrome
Google Chrome is the most popular browser on the desktop at the moment, but is it the best? I was a reasonably early adopter of Chrome and fell in love with its speed. Nowadays I don’t use Chrome at all. What happened? When I first started using Chrome, the things I loved that set it …
Beautify Your LESS Stylesheets With Indentation Etc
After a couple of cut and paste jobs I had some LESS files with really ugly looking indentation. After a fruitless search for a tool to auto-format my LESS stylesheets, I decided to build a quick and dirty php script to do the job. I’m a notepad++ user and while it comes with some nice …
How To Send Users To Different Welcome Pages Based On User Level In S2Member
A very common requirement for membership sites is the ability to send a user that is logging in to a specific home page. With S2Member there are a couple of ways to accomplish this. I came across some solutions involving javascript, which I think is a bad idea for a number of reasons. I’ll share …
Check WordPress User Role By ID
While working on a membership site I wanted to retrieve a user’s role by their user id, but I couldn’t find a quick function to do this. WordPress does provide the WP_User object which gives us quick access to all user information, including user roles. To get the user role by a given ID we can …