Take a look at this post for a list of useful “hidden” configuration settings for your WordPress installation.
I found some nice tricks that I’ve applied to my wp-config.php:
// Number of post revision to keep
define('WP_POST_REVISIONS', 3);
// Installation path and template path to reduce database queries
define('WP_HOME', 'http://your_site_url.com');
define('WP_SITEURL', 'http://your_wordpress_directory_url.com');
define('TEMPLATEPATH', '/absolute/path/to/wp-content/themes/active-theme');
define('STYLESHEETPATH', '/absolute/path/to/wp-content/themes/active-theme');
// Security keys to improve cookies encription
define('AUTH_KEY', 'randomKey');
define('SECURE_AUTH_KEY', 'randomKey');
define('LOGGED_IN_KEY', 'randomKey');
define('NONCE_KEY', 'randomKey');
via Digging Into Wordpress.
Categories: Uncategorized.
Tags: WordPress
This is a simple tip that can help you reduce your style sheet size. Take a look at this CSS portion:
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 1.1em;
font-weight: bold;
font-style: italic;
line-height: 1.5em;
font-variant: uppercase;
All these properties can be condensed into a one row expression using this syntax:
font: fontSize/lineHeight weight style variant family;
See the example below:
font: 1.1em/1.5em bold italic uppercase Arial,Verdana,Helvetica,sans-serif;
Just remember that this syntax will only function if you specify both font-size and font-family.
Categories: HTML & CSS.
Tags: CSS, font, style
A useful XSL template for removing leading zeros
<xsl:template name="removeLeadingZeros">
<xsl:param name="originalString"/>
<xsl:choose>
<xsl:when test="starts-with($originalString,'0')">
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="originalString">
<xsl:value-of select="substring-after($originalString,'0' )"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$originalString"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Just insert it into your XSL file and use it as usual:
<xsl:call-template name="removeLeadingZeros">
<xsl:with-param name="originalString" select="$myOriginalString"/>
</xsl:call-template>
Categories: XML.
Tags: XML, XSL, XSL template
A simple bash script that zips a folder and sets the archive name to the current date.
#!/bin/bash
# Archive name structure: ddMMYYYY_HHmmss.zip
archiveName=`date +%d%m%Y_%H%M%S`.zip
folderName=MyFolder
zip -r $archiveName $folderName
Categories: Linux.
Tags: backup, bash, Linux, script, zip
A really good tutorial on building custom taxonomies in WordPress 2.8.
Custom taxonomies in WordPress 2.8
Categories: Links.
Tags: taxonomy, tutorial, WordPress