Flexbox cheatsheet

update: this is a very useful cheatsheet also (with lots of pics to explain) css tricks guide to flexbox Equal width columns (responsive i.e. Rows on small screen width) <div class=”container”> <div ></div> <div ></div> <div ></div> </div> .container { display:flex; } .container div {flex-basis:100%;} @media screen and (max-width:600px) { .container { flex-direction: column; } … Read more

WordPress on Windows IIS permissions error – uploaded file could not be moved to wp-content/uploads

Recently I’ve been developing a WordPress Intranet for a company that runs on Windows hosting ( IIS 6 – Internet Information Services ). I ran into a problem with file permissions and not being able to write to the wp-content/uploads directory, I’ve ran into the same problem with unix many times (which alittle bit of recursive … Read more

How to add a form to a shortcode in WordPress (using PHP and Ajax)

Recently I needed to develop a Shortcode that would display a form, this blog post details what I did. I used Ajax ( which seems the best way to add forms to shortcodes, but I’d welcome any input from other developers on your approach). So without further ado lets get on with adding a form to … Read more

How to get a users Roles and how to list all WordPress roles in PHP

This code is handy if you want to find out a users role/s. You could expand it and check if a user has a given role or similar. $user_info = get_userdata(2152); echo ‘Username: ‘ . $user_info->user_login . “\n”; echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “\n”; echo ‘User ID: ‘ . $user_info->ID . … Read more