Skip to content

Instantly share code, notes, and snippets.

View benfurfie's full-sized avatar

Ben Furfie benfurfie

  • Netnak
  • Oxton, Greater Liverpool, UK
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>WP JSON Front End Test</title>
</head>
<body>
<h1 class="title"></h1>
<div class="content"></div>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="public/controller.js"></script>
$(document).ready(function(){
$.ajax({
url: "http://www.wpjsonapi.dev/wp-json/posts/1"
}).then(function(data) {
$('.title').append(data.title);
$('.content').append(data.content);
});
});
@benfurfie
benfurfie / cookie_notice.html
Created January 12, 2017 07:15 — forked from Jamesyps/cookie_notice.html
Perch Cookie Consent
@benfurfie
benfurfie / .htaccess
Created January 12, 2017 07:44 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "BreadcrumbList",
"itemListElement": [
{{ nav:breadcrumbs }}
{
"@type": "ListItem",
"position": "{{ index }}",
"item": {
@benfurfie
benfurfie / MySQL_5-7_macOS.md
Created November 2, 2018 15:39 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
^[0-9A-Za-zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñðòóôõöùúûüýÿ\s\-\–]*$
{
"devDependencies": {
"laravel-mix": "^4.0.15",
"tailwindcss": "^1.0.1",
"vue-template-compiler": "^2.6.10"
},
"scripts": {
"dev": "yarn run development",
"development": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "yarn run development --watch",
<?php
public function pluck($value, $params, $context)
{
if (!is_array($value)) {
return $value;
}
return array_pluck($value, $params[0]);
}
@benfurfie
benfurfie / wordpress-cheatsheet.md
Created October 2, 2019 08:25
WordPress Cheatsheet

WordPress Cheatsheet

CPTs

Hiding entries from view

Sometimes you want to have a CPT, but not have single post entries for each item, such as a slider, which queries entries to build up an array of items.