WordPress: Display a message or other text in a page or post only to logged in users

You can use this to post advice or reminders to logged in users when they need to perform different tasks. All you have to do is add the following anywhere in your theme you want to display the message. ​ Create a shortcode to detect logged in users To turn this into a shortcode so you can use it in your posts you can just use the below snippet add this into your functions.php page. To use...
Read More

Fixing photo orientation on images uploaded via PHP from iOS devices

Below is a great function (created by Wes over on Stack Overflow) that can be used to automatically correct the image orientation when uploading images (the main culprit for weird orientation related glitches being iOS based devices) - simple call the correctImageOrientation() function after uploading the image and voilla the rotation/orientation of the image is corrected! The function:...
Read More

Resolving the “Numeric value out of range: 1690 BIGINT UNSIGNED” error in Magento

Recently when making some changes on a Magento based store we encountered a mySQL error in the Magento administration pages when trying to delete products which prevented any further products from being deleted. The error message SQLSTATE : Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in ‘(`YOURDB`.`q`.`items_count` – 1)’ Resolving the error Log...
Read More

Customising the “Submitted by” text in Drupal 7

Customising the default "Submitted by..." text used in Drupal 7 is pretty simple, and just required a single edit to your theme's template file. Go to your ./themes/yourtheme folder and open the template.php file in your text editor. Add the function below at the end of the template.php file (remember to replace "yourthemename" with the actual name of your theme). '!datetime' => $vars , )); }...
Read More

Remove “All Day” from Date field output in Drupal 7

We use the Date module for Drupal for a lot of the sites we develop, some require a date to be displayed, for example in a listing of events or "dates for your diary" but don't want to list a time or have the date listed as an "All Day" event. The answer is pretty simple, just add the below into your theme's template.php <?php function _date_all_day_label() { return ""; } ?>
Read More