This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fun little quiz | |
Assuming this string: "January 5th, 2012" | |
In the shortest amount of code possible, place: | |
- 'January' within a $month variable | |
- '5th' within a $day variable | |
- '2012' within a $year variable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This goes in your #server-config | |
<VirtualHost *:80> | |
ServerName bobswordpress.dev | |
ServerAdmin [email protected] | |
DocumentRoot /var/www/bobswordpress.dev/ | |
ServerAlias www.bobswordpress.dev | |
DirectoryIndex index.html index.php | |
<Directory /var/www/bobswordpress.dev/> | |
Options FollowSymLinks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !dispatch\.php$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^api/([^/\.]+)/([^/\.]+)/?$ dispatch.php [L,QSA] | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#How to get this to work... | |
#First create your password file: | |
# - Replace $FILE and $USER with your values | |
# $> htpasswd -c $FILE $USER | |
#This goes into your apache config | |
# - Replace /PATH/TO/$FILE with the full path (incl file) to your | |
# created password file | |
<Files "wp-login.php"> | |
AuthUserFile /PATH/TO/$FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Domain Redirect | |
<IfModule mod_rewrite.c> | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^(www\.)?huntlywordpress\.co\.uk$ [NC] | |
RewriteRule ^ http://www.huntlywordpress.com%{REQUEST_URI} [R=301,L] | |
</IfModule> | |
#EndDomain Redirect | |
#BEGIN custom redirects (single page) | |
<IfModule mod_rewrite.c> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Uploading files | |
Taken from: http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/ | |
INSTRUCTIONS: | |
In the page you wish to use this script you'll need to enque the media scripts and this script. | |
Then create a input box and a button with NOTHING in between.. with the class 'upload_image_button' | |
<?php | |
wp_enqueue_media(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function documentation for 'hc_rse_get_events($listType, $showEvents = -1, $startdate = -1, $enddate = -1)' | |
* Depending on the list type, get the events | |
* | |
* @param str $listType - [all|all-reverse|upcoming|upcoming-reverse|past|past-reverse] | |
* @param int $showEvents (optional) - the number of events to show | |
* @param date $startdate (optional) - date range to start | |
* @param date $enddate (optional) - date range to finish | |
* @return $wpdb result set $events - Result set of the query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Setup the shortcode: | |
// [rse_custom_events] - this works the same as the normal one | |
add_shortcode( 'rse_custom_events' , 'customised_event_table' ); | |
/** | |
* Parses the shortcode and displays the events. The defalt is to only show | |
* events which are happening from the current time onwards. To change this | |
* the user can suppy the 'showevents' attribute with one of the following |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Huntly Cameron <[email protected]> | |
# Date: 2015-01-25 | |
# Licence: MIT | |
# Description: if working dir, lists the root forlders of the repo + branches | |
## | |
# Try an info and redriect err to std input so we can save it to the status var | |
status=$(svn info 2>&1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* wrapWoocommerceImages() | |
* | |
* Wraps woocommerce product images with spans making it easier to apply custom styles. | |
* | |
* This is a slightly more involved approach based on this gist: | |
* https://gist.github.com/Bradley-D/9479200 | |
* |
OlderNewer