Skip to content

Instantly share code, notes, and snippets.

View twobyte's full-sized avatar
😋

Toby Trembath twobyte

😋
View GitHub Profile
public function tasty_team_breadcrumb( $crumb, $args ) {
// Only modify the breadcrumb if in the correct post type
if( $this->post_type !== get_post_type() )
return $crumb;
// Grab terms
// Primary category support if available.
if ( class_exists('WPSEO_Primary_Term') )
{
// Show the post's 'Primary' category, if this Yoast feature is available, & one is set
/**
* Over-ride bootstrap 4 .col-1 .col-2 flex grid styles conflict in Woocommerce layout styles
*/
.woocommerce,
.woocommerce-page {
.col2-set {
.col-1,
.col-2 {
max-width:none;
flex: none;
@twobyte
twobyte / acfblocks.php
Created January 11, 2021 19:23
ACF Gutenberg blocks example where Taxonomy fields won’t update / cannot be edited.
<?php
add_action('acf/init', 'my_register_blocks');
function my_register_blocks() {
// check function exists.
if( function_exists('acf_register_block_type') ) {
//if(class_exists('Portfolio_Post_Type')){
// register a project slider block.
@twobyte
twobyte / get-admin-path.php
Created October 23, 2020 14:01 — forked from andrezrv/get-admin-path.php
Obtain path to wp-admin directory in WordPress.
<?php
/**
* Obtain the path to the admin directory.
*
* @return string
*/
function my_plugin_get_admin_path() {
// Replace the site base URL with the absolute path to its installation directory.
$admin_path = str_replace( get_bloginfo( 'url' ) . '/', ABSPATH, get_admin_url() );
@twobyte
twobyte / gulpfile.js
Created February 16, 2017 10:34
Example of javascript bundling using Gulp
/*jslint node: true */
"use strict";
const $ = require('gulp-load-plugins')();
const argv = require('yargs').argv;
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const merge = require('merge-stream');
const colors = require('colors');
const gutil = require('gulp-util');