Here is a list of useful commands that I find myself having to look up fairly often : Move contents of folder one folder up and remove said folder From the subfolder that you no longer need : mv * .[^.]* .. Modifying hosts file (Mac/ Linux) sudo vi /etc/hosts
Quick Tips
Installing Theme Unit Test Data with wp-cli
When building custom themes client sites it is important to test as many edge case as possible. Theme Unit Test Data is the way to go here and a minimum requirement for any professionally built WordPress theme (in my opinion anyway) If building a theme for the wordpress.org theme repository this will almost certainly be …Continue reading
Using WP-CLI for database synchronisation
There are a great many tools that duplicate sites and synchronise databases between sites. Some favourites are Duplicator, WP Migrate and WP Migrate Pro, as well as good old phpMyAdmin. However, sometimes all that is needed is to import the database and then do a search and replace. This is easier said than done however …Continue reading
CSS Fancy Quotes
There are all sorts of HTML elements that concern quotes and quoting things. I’ll let you sort out the appropriate one here. When it come to styling them you have several choices as well. You can put quotes around the quoted string or you can style the blockquote element. The main difference is whether you …Continue reading
Unix Command Cheatsheet
This is a conglomeration of several online cheatsheets, the origins of which are noted in the resources section below. It also includes my own notes, any of this is open for discussion. Please feel free to correct any wrong information or to include any which are vital but may have been overlooked.
CSS Properties: object-fit and object-postion
CSS has many obscure properties that can can really make a difference with browsers that support them. Two of these are object-fit and object-position. The benefits of these two properties is that the allow us to determine the portion of an image that will be seen at various widths, so that by using media-queries different …Continue reading
Per Site Plugins for WordPress Multisite
One of the advantages of using a MultiSite in WordPress is that plugins can be shared between sites and enabled on a per site basis. This makes for easier plugin and theme updates for the whole network. But what about cases when you don’t want the plugin to be available for all sites in the …Continue reading
Allow HTML code in WordPress tagline
Maybe its just me but I always feel like the site description or WordPress tagline begs for some styling. Here’s an easy one to use as an example*: The Future’s Bright. The Future’s orange In order to output the Tagline most themes use the get_bloginfo() function, esc_html( get_bloginfo( ‘description’ ) ) or just get_bloginfo( …Continue reading
Force Download PDF in WordPress
WordPress already enables you to to download PDFs and other file types simply by changing the attachment link in the media library. Like so: But what if you want to force it to download instead of opening it up in another window? This is a quick one now so pay attention. in an .htaccess file: …Continue reading
Force SSL for WordPress Media Attachments
Case scenario: you have certain pages on your site that force SSL but not all. You notice that the culprits (i.e. pesky buggers that are still being served using http://) are all coming from the uploads folder and are in the media library. https://gist.github.com/d81af526fa6b6f2808f9 Cheers to the anonymous Ludovic who came up with this seemingly …Continue reading