This file contains 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 | |
//Paste the code below into the widget logic field of you widget and edit the page IDs as needed | |
//The code below will display your widget on pages 8,9 and 10 and any page that is a child of page 8 | |
global $post; return (is_page(array(8,9,10)) || in_array($post->post_parent, array(8))); | |
//The code below will display you widget on pages that us the faq-page.php template file | |
global $post; return (get_page_template_slug( $post->ID ) == 'page-templates/faq-page.php'); |
This file contains 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
ln -s `which php72` ~/bin/php | |
export PATH=$HOME/bin:$PATH | |
cd bin | |
curl -sS https://getcomposer.org/installer | php72 | |
echo -e "\n# Composer\nalias composer=\"php72 \$HOME/bin/composer.phar\"" >> $HOME/.bash_profile | |
source $HOME/.bash_profile |
This file contains 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
// add the action | |
add_action('wp_print_styles', 'ac_remove_default_styles'); | |
function ac_remove_default_styles () | |
{ | |
// get all styles data | |
global $wp_styles; | |
$styles_to_keep = array('admin-menu'); |
This file contains 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
function ac_inspect_scripts() { | |
global $wp_styles; | |
echo '<script id="ac_inspect_scripts">'; | |
foreach( $wp_styles->queue as $handle ) : | |
echo 'console.log("' . $handle . '");'; | |
endforeach; | |
echo '</script>'; | |
} | |
add_action( 'wp_print_scripts', 'ac_inspect_scripts' ); |
This file contains 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
#Run this in terminal before starting vagrant ssh | |
export VAGRANT_PREFER_SYSTEM_BIN=1 |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "scotch/box" | |
config.vm.network "private_network", ip: "192.168.33.25" | |
config.vm.hostname = "scotchbox" | |
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"] | |
config.vm.provision :shell, path: "phpmyadmin.sh" |
This file contains 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
function titleCase(str) { | |
str = str.toLowerCase().split(' '); | |
for (var i = 0; i < str.length; i++) { | |
str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1); | |
} | |
return str.join(' '); | |
} | |
var bcElements = document.querySelectorAll('[data-breadcrumbs]'); | |
var currentPath = window.location.pathname; |
This file contains 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
function refreshAt(hours, minutes, seconds) { | |
var now = new Date(); | |
var then = new Date(); | |
if(now.getHours() > hours || | |
(now.getHours() == hours && now.getMinutes() > minutes) || | |
now.getHours() == hours && now.getMinutes() == minutes && now.getSeconds() >= seconds) { | |
then.setDate(now.getDate() + 1); | |
} | |
then.setHours(hours); |
This file contains 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
# ssh to your vagrant server (scotchbox) | |
vagrant ssh | |
# swich to super user account (administrator / root) | |
sudo su | |
# update apt-get | |
apt-get update | |
# install the latest version of xml support for php7 | |
apt-get install php7.0-xml | |
# install the latest version of xml support for php7 |
This file contains 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
/** | |
* Created by Richard on 19/09/2016. | |
*/ | |
//console.log('ACTIMBER'); | |
ACSCRIPT = { | |
common: { | |
init: function () { | |
'use strict'; | |
//uncomment to debug |