Blog Archives

CSS iOS div lines disappear on zoom in

Problem In iOS devices sometimes safari can display an annoying line above and below div elements.  Like so:   Solution The solution is quite hacky and hopefully this is a bug in Safari and it gets fixed soon.  The solution is

Tagged with: , ,
Posted in Coding

Pseudo Selector First Child of Class

Problem How do you apply a style to only the first element with a certain class? :first-child does not do this, that just selects the very first child no matter what the class is. :first-of-type doesn’t even do this.  but

Tagged with:
Posted in Coding

Vertically Center Anything With Dimensions

One way to easily vertically center a div is to set it to be absolute, set the width, height and then the top, bottom, left and right all equal to 0.  Something like this: From: http://stackoverflow.com/questions/356809/best-way-to-center-a-div-on-a-page-vertically-and-horizontally

Tagged with:
Posted in Coding

Easy Way to Add a Class to a Menu Item in WordPress

Go to Appearance -> Menus.  Open up Screen Options in the top right.  Click on the CSS Classes checkbox under Show Advanced menu properties.  Now each menu item has a textbox where you can enter css classes.

Tagged with:
Posted in Coding

Best way to detect Retina with Javascript

Best way according to W3C standards: http://stackoverflow.com/questions/19689715/what-is-the-best-way-to-detect-retina-support-on-a-device-using-javascript

Tagged with: ,
Posted in Coding

WordPress Heartbeat API

I could not find any extensive documentation on the WordPress Heartbeat API, so I am writing here to remember what I have learned through various tutorials throughout the web. The Heartbeat API is written in Javascript.  Think of it like a

Tagged with: , ,
Posted in Coding

edit_users capability on multisite

No matter how hard you try, if you add the edit_user capability to a user on multi-site and that user is not a super-admin, the user will not have the edit_user capability.  This is hard-coded into WP_User’s map_meta_cap.  There is a filter

Tagged with: ,
Posted in Coding

WordPress is Not Remembering Me

Problem All these years I’ve been checking the “Remember Me” checkbox when logging in every once in a while in hopes that WordPress will one day actually remember me.  I don’t think it ever did, but I didn’t really mind or notice

Tagged with:
Posted in Coding

Migrating Multisite to Single Site

I needed to migrate a site on a multisite installation to a single installation.  This article did the trick for the most part.   http://beacon.wharton.upenn.edu/404/2011/02/the-return-from-multisite/

Tagged with: ,
Posted in Coding

Bootstrap Tab linking

If you use Bootstrap (v3.x) you would see that clicking on a tab does add anything to the url so if you were to refresh, you wouldn’t go back to the tab you are on.  The post below says to

Tagged with: , ,
Posted in Coding