PHP Echo If Examples

Glenn Glenn's Blog 0 Comments

There are a number of ways to echo PHP ‘If’ a statement is true. The most common syntax is:- So something like:- The example will output if the current time (HOUR) is less than 12. Echo HTML or PHP in PHP If Statement We also like to use an alternate echo that allows you to inject PHP or HTML within the …

How to get your Facebook ID

Glenn Glenn's Blog 0 Comments

These days Facebook tends not to show IDs, but rather a human readable link for your page such as https://www.facebook.com/username\companyname. However many scripts and WordPress plugins require the physical ‘ID’ which is a numerical number. You can still retrieve this number via the following tool:- https://graph.facebook.com/username Replace your ‘useranme’ with your actual Facebook username (company name, page name etc) and …

Less Hover Mixin

Glenn Glenn's Blog 0 Comments

Not redly publicised but ever so simple:- [css] /* Button*/ .button { // Normal CSS Classes background: @white; &:hover { // adding my own hover state for button background: @black; } } [/css] Rather than ‘class:hover’ we use &:hover and then add our css / less below.

Limit Number of Words in WP e-Commerce Description and Custom Excerpts

Glenn Glenn's Blog 0 Comments

This was an unanswered question on the WP e-Commerce blog and we needed to create a solution to it for a client project. Oddly WP e-commerce doesn’t limit the number of characters shown in ‘wpsc_the_product_description();’ out of the box and the result is that when you show product descriptions they can look untidy in length and layout. Our solution is …

Install MySQL on OS X Mavericks

Glenn Glenn's Blog 2 Comments

If like us you want to run the wonderful WordPress on your local development server on OS X Server then, in addition to the pre-bundled Apache & PHP, you are also going to need a database – MySQL. Now you could download the latest version of the MySQL Community Server and run various commands in Terminal, but if like us …