Select Page

Filter the Body Class

If you want to customise the CSS styling on a particular page, you can assign a body class using the body_class filter. Simply add the following code to your functions.php file and replace ‘blog’ with the slug of your page and ‘wpt-blog’ with...

Define Maximum Number of Post Revisions

Revisions¬†can be a life saver when you’re editing posts but you can end up with hundreds of them if you don’t set a limit. By adding this snippet to your wp-config.php file in the root of your WordPress installation, you can set the maximum number of...

Force All Pages to Load Over HTTPS (SSL)

If your server runs Apache, add this code to your .htaccess file to force all pages to load over HTTPS: # BEGIN Force HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # END Force...

Load post images over HTTPS

Add this to your functions.php file to load all images in your post content over HTTPS: function load_images_https( $content ) { $content = str_replace( 'src="http:', 'src="https:', $content ); return $content; }