Don’t Load it till it’s Needed

The average web page has nearly doubled in size since 2010. While this might not come as a surprise to any of us, there is certainly plenty that we can do to scale back the weight of our web pages. One of my favourite ways to prevent page bloat is to treat everything as a resource that doesn’t need to be on the page until the user has to interact with it. The technique is called lazy-loading, and can be performed on almost any asset. It’s especially good for responsive…

wp-content – permissions for files/folders created by apache

My wp-content folder has owner User and group www-data. The permissions are 775 for folders and 664 for files, so the server can write inside the folder. But when the server creates folder and files inside wp-content ( when installing theme ), they have the server as owner ( and the server’s primary group ) and they get 755 for folder and 644 for files. So I can’t keep all folders and files of a WordPress installation under User ownership. How can I make all newly created folders and files…

Web Design Weekly #183

Headlines More Weight Doesn’t Mean More Wait Scott Jehl takes a look at Wired’s new site and explains a few optimization tweaks that could massively improve the perceived performance. As always, awesome post by Scott. (filamentgroup.com) mdo-ular CSS Mark Otto explains ten guidelines on how he write better CSS. So many awesome simple tips. Make time for it. (jqueryuk.com) Pixel Perfect Responsive Sites. Code Free. Webydo is a professional website design platform that empowers graphic and web designers to create and manage pixel-perfect responsive websites for their clients, completely code-free. Try…

Change meta tags programatically

Is there a way to change the meta tags not in the head but in a template file through code? I would like to change the meta tags <meta property= »og:title » content= »title » /> <meta property= »og:description » content= »description » /> <meta property= »og:image » content= »thumbnail_image » /> They are automatically set when calling the facebook SDK. Is there a way to change these tags in my code (not in header.php)? I’ve tried to do this in my child template (content-share.php): <?php add_action( ‘wp_head’, ‘add_meta_tags’ , 10 ); ?> And then in functions.php of my theme I have:…

Multiple navigation menus to a location?

I want to be able to assign multiple menu’s to 1 navigation location. But when I want to assign the second navigation, the previous is unassigned. How would it be possible without breaking the WordPress core files? This is what I am aiming for: How can I display a menu on certain pages only? Source: https://wordpress.stackexchange.com/feeds

Proper Way to Sanitize Meta Input

I have a meta field which gets displaed in the admin panel look like: $field = get_post_meta($postid, ‘field_name’, true); ?> <input type= »text » name= »field_name » value= »<?php echo (!empty($field)) ? $field :  »; ?> » /> And usually whenever I save these sorts of things I use sanitize_text_field() which I thought that was enough, until today… Today I realized that it doesn’t properly encode any html entities, such as quotations. For example: Say the user enters into my text field Matt said « Jet fuel can’t melt steel beams… » Which can be sanitized using the…

Web Design Weekly #182

Headlines Look and Feel and Feel Jason Fried reflects on a personal experience which has now changed the way he approaches the important aspects when designing. (signalvnoise.com) Learn UX Design in 8 Weeks, with an Expert Mentor! Looking to polish your UX skills? Learn 1-on-1 with expert designers from Adaptive Path, Stanford, Pivotal Labs and more – and enhance your portfolio with real-world projects. Join SlideRule’s UX Design School today. (mysliderule.com) Articles Blowing up LocalStorage What happens when you exceed the quota limit in a browser’s LocalStorage system? Raymond Camden…

Multisite infinite redirect loop

I cannot login to dashboard after installing multisite – I have infinite redirect loop to login page. Here is what I have added to wp-config /* Multisite */ define( ‘WP_ALLOW_MULTISITE’, true ); define(‘MULTISITE’, true); define(‘SUBDOMAIN_INSTALL’, false); define(‘DOMAIN_CURRENT_SITE’, ‘nazarserdyuk.com’); define(‘PATH_CURRENT_SITE’, ‘/’); define(‘SITE_ID_CURRENT_SITE’, 1); define(‘BLOG_ID_CURRENT_SITE’, 1); Here is what I have in .htaccess # BEGIN WPSuperCache # END WPSuperCache # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^…

How do I share categories across selected sites in a Multisite setup

I’ve got a Multisite network that looks something like this: Site A Site B Site C Site D Site E and have a set of Categories like this: Category A Category B Category C Category D Category E These Categories relate to the Sites. i.e. Category A is what Site A is all about. However there will be posts that may be relevant to multiple sites in which case you would select multiple Categories. So, each Site would list all Categories (as check boxes). Is there a simple way to…

Web Design Weekly #181

Headlines 15 Years of Dao If you are relatively new to this “Web Design” thing you may not have read John Allsopp’s A Dao of Web Design. Over the years John’s article has been the most influential web design article and this year the team at A List Apart have compiled a large list of thoughts by amazing people. Without further ado, grab yourself a coffee and enjoy the words of wisdom. (alistapart.com) Paul Rand, the Visionary Who Showed Us That Design Matters (wired.com) The New Colossal Bundle: $20,271 worth…