To use this file simply add this to your WordPress theme (in your includes
folder or similar) then add the following to your functions.php file:
require_once(get_template_directory() . '/includes/class.wp-brunch.php');| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) header('X-UA-Compatible: IE=edge,chrome=1'); ?> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /> | |
| <title>Untitled</title> | |
| <!-- Latest compiled and minified CSS --> | |
| <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
| <!-- Optional theme --> |
| { | |
| "always_show_minimap_viewport": true, | |
| "bold_folder_labels": true, | |
| "color_scheme": "Packages/User/SublimeLinter/Material-Theme (SL).tmTheme", | |
| "ensure_newline_at_eof_on_save": true, | |
| "font_options": | |
| [ | |
| "gray_antialias" | |
| ], | |
| "font_size": 14, |
| #/bin/bash | |
| function get_branch { | |
| valid_branches=("theme" "component") | |
| if `echo ${valid_branches[@]} | grep -qw "$1"`; then | |
| echo "Branch selected: $1-framework" | |
| git clone -b "$1-framework" git@github.com:1minus1limited/wp-with-brunch.git . | |
| rm -rf .git .gitignore |
I recently came across an issue whereby installing the popular Yoast SEO plugin caused the frontend of a production site to crash, stating that it couldn't find many of the custom PHP classes written and included in the project theme via the __autoload() php function.
I found others had experienced similar issues when trying to use Yoast with custom PHP classes but not found a fix. Although this issue was also known to the Yoast plugin authors, a fix had yet to appear, so I started to try to find/create a fix myself.
| (function($) { | |
| $.fn.isOnScreen = function(x_offset, y_offset) { | |
| if(x_offset == null || typeof x_offset == 'undefined') x_offset = 1; | |
| if(y_offset == null || typeof y_offset == 'undefined') y_offset = 1; | |
| var win = $(window), | |
| viewport = { | |
| top : win.scrollTop(), | |
| left : win.scrollLeft() | |
| }, |
Follow initial install instructions here
Add the following to the bottom (but inside the <IfModule /> block) of /etc/apache2/mods-available/pagespeed.conf
# Export current (local) DB
wp db export db.sql
# Copy file from local to server (may need to amend server path if not in html folder)
# The example below is for local to remote, simply swap these 2 around for remote to local
scp -r db.sql www-data@IP_ADDRESS:/var/www/html
# SSH onto box (should be same connection details as above)