Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
@gemmadlou
gemmadlou / readme.md
Last active September 6, 2016 05:24
Wordpress Multisite On Docker

In your docker-compose.yaml:

```
version: "2"

services:
    nginx-proxy:
        image: jwilder/nginx-proxy
        container_name: nginx-proxy
        ports:
<!-- Get Previous Post -->
<?php
$prev_post = get_previous_post();
if (!empty( $prev_post )): ?>
<a href="<?php echo get_the_permalink($prev_post->ID); ?>">
<span class="c-button c-button-full-width read-more c-button--summer-orange-light">Previous</span>
</a>
<?php endif; ?>
@gemmadlou
gemmadlou / readme.md
Created September 7, 2016 06:23
Managing Wordpress
@gemmadlou
gemmadlou / gulpfile.js
Created September 12, 2016 13:12 — forked from sagalbot/gulpfile.js
Laravel Elixir + Vueify + Hot Reload. This will get you up and running with Browserify HMR + Vueify + BrowserSync in no time.
var elixir = require('laravel-elixir');
var gutil = require('gulp-util');
// If 'gulp watch' is run
if (gutil.env._.indexOf('watch') > -1) {
// Enable watchify for faster builds
elixir.config.js.browserify.watchify.enabled = true
@gemmadlou
gemmadlou / filtersort.js
Created September 27, 2016 16:13
Declarative Filtering & Sorting (with jQuery Selectors)
/* global jQuery */
/*jshint esversion: 6 */
/**
* Use a singleton
* Declare trigger options declaratively in code
*
*
* @TODO provide a polyfill for maps
* @TODO make library agnostic - especially jQuery
@gemmadlou
gemmadlou / readme.md
Last active September 28, 2016 08:36
Functional & Declarative Programming
@gemmadlou
gemmadlou / model_dictionary.js
Last active September 30, 2016 12:06
Dictionary Model
// Dependency on Rambda
var Person = (properties) => {
return R.pick(['firstname', 'lastname', 'email'], properties);
}
var G = Person({firstname:'Gemma', lastname: 'Black', email: 'gbabc.com'});
var User = {
business: (properties) => {
@gemmadlou
gemmadlou / svg-image-icons.sass
Created October 10, 2016 14:04
SVG Image Icons
// Compatible with IE10
@function svg-url($svg) {
@if not str-index($svg,xmlns) {
$svg: str-replace($svg, '<svg','<svg xmlns="http://www.w3.org/2000/svg"');
}
$encoded:'';
$slice: 2000;
@gemmadlou
gemmadlou / remove-visual-composer-shortcodes.md
Last active October 16, 2024 00:28
Removing Visual Composer & Shortcodes From Wordpress Content

Adding @k1sul1's suggestion from the comments as it's more concise than what I had before:

I just wanted them all gone, so I ran this in the MySQL shell.

UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, "\\[\/?vc(.*?)\]", "");

Note the double backslash. If you forget it, you'll replace all v's and c's with nothing, and the shortcodes will still be there. This works for other shortcode as well, just replace vc.

@gemmadlou
gemmadlou / acf-panel-config.php
Last active December 8, 2017 17:13
ACF Flexible Content (Programmatically)
<?php
return [
'group_btm_flex_default',
[
'title' => 'Page Content Builder',
'label' => 'Add content',
'location' => [
[
[