Single post hook
All posts by
AJAX Dynamic Page Content
Simple ajax call to dynamically load page content, solving issues of page caching etc. Ensure jquery is activated In your function that hooks “wp_enqueue_scripts”, add this: HTML AJAX Callback
Keep Users Logged In
Setting A Custom Session Timeout
Text Containers
Force text to break even if it has no spaces in it
Creating cron function
Setting Up cron within wordpress Using standard recurrence values Standard recurrence values are ‘hourly’, ‘daily’ and ‘twicedaily’. Using your own recurrence values If you want something different from the standard recurrence values you can add the below to define them: Configuring WordPress to use your setup Run this once to setup with the new configuration […]
Create Random Value Within A Query
RAND() returns a random number >= 0 and <1 So the following returns a random integer between 0 and <50: The following returns a random integer between 10 and <60:
DateTime
INSERT or UPDATE row to be Now + # Days Some of the values you can use: DAYHOURMINUTEMONTHSECONDWEEKYEAR Update a DateTime with a random value
Numeric values
Increment Decrement but don’t go below a value GREATEST allows you to specify that the greater of multiple values should used. So in this example if the value drops below zero, zero will be greater used: Increment but don’t go above a value LEAST allows you to specify that the lower of multiple values should […]
Creating a cron job
The job file A cron job is simply a file the OS will call periodically for you. So just create a php file that will do what you want when you load it. This means if you use it as a browser address it will also run and do the cron tasks – handy for […]
iOS home screen icon
On iOS devices using the Safari browser when you add a web page shortcut to your home screen if will display as a screenshot of the website by default. To use an icon instead do the following: Create your icon as a 180x180px .png file (good for all iOS devices – those with regular displays […]