Skip to content

Instantly share code, notes, and snippets.

@bob-moore
bob-moore / Readme.txt
Last active June 6, 2016 16:58
Related Navigation in Wordpress
Purpose: Display navigation of a pages siblings and children.
1. Children / Grandchildren of SIBLING top level pages are hidden (visually)
2. All top level pages are visible, and the navigation down to 1 level below the current page
2. Items are not expandable, the purpose is not to provide a full navigation menu, instead the goal is to provide links Nth levels up, and 1 level down the navigational tree.
In this way, as pages are added / removed from the site, they are automatically represented in the related navigation tree.
@bob-moore
bob-moore / jptweaks.php
Created June 13, 2016 14:15
Jetpack Sharing Display Tweaks
<?php
/**
* Filter to stop jetpack from automatically inserting like buttons, so we can
* manually control their output
*/
if( !function_exists( 'jptweak_remove_share' ) ) {
function jptweak_remove_share() {
remove_filter( 'the_content', 'sharing_display',19 );
remove_filter( 'the_excerpt', 'sharing_display',19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
@bob-moore
bob-moore / Bones List.md
Last active September 14, 2016 14:03
Grunt Configuration for Bones With LESS
Theme Number Name
1 Pilot
2 The Man in the S.U.V.
3 A Boy in a Tree
4 The Man in the Bear
5 A Boy in a Bush
6 The Man in the Wall
7 A Man on Death Row
8 The Girl in the Fridge
@bob-moore
bob-moore / gruntfile.js
Last active August 18, 2016 14:23
Grunt Configuration for Mpress w/ SCSS
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-openport');
grunt.loadNpmTasks('grunt-contrib-watch');
@bob-moore
bob-moore / Markup.php
Created September 8, 2016 17:10
Sticky Sidebar
<div id="primary">
<div id="main" class="column md-8">
<!-- Main Content Here -->
</div>
<div id="sidebar" class="column md-4">
<div id="not-sticky-widget-area">
<!-- Put not sticky sidebar here -->
</div>
<div id="sticky-widget-area">
<!-- Put sticky sidebar here -->
@bob-moore
bob-moore / blockquotes.html
Last active October 12, 2016 16:59
MPress Style Guide
<blockquote>
<p>Stay hungry. Stay foolish.</p>
</blockquote>
<blockquote>
<p>People think focus means saying yes to the thing you've got to focus on. But that's not what it means at all. It means saying no to the hundred other good ideas that there are. You have to pick carefully. I'm actually as proud of the things we haven't done as the things I have done. Innovation is saying no to 1,000 things.</p>
<footer><cite>Steve Jobs</cite> - Apple Worldwide Developers' Conference, 1997</footer>
</blockquote>
@bob-moore
bob-moore / wp-config-debug.php
Last active June 12, 2024 13:56
Wordpress Debugging Settings
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
define( 'SCRIPT_DEBUG', true );
define( 'JETPACK_DEV_DEBUG', true );
@bob-moore
bob-moore / jp_tweak.php
Created April 27, 2017 16:09
Functions to tweak share button placement of jetpack
<?php
/**
* Function to remove automatic placement of sharing buttons from jetpack
*/
if( !function_exists( 'jptweak_remove_share' ) ) {
function jptweak_remove_share() {
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
@bob-moore
bob-moore / functions.php
Last active September 12, 2017 17:51
Quick ACF page section stuff
<?php
function display_acf_page_sections() {
// Construct ID
$id = !empty( get_sub_field('section_id') ) ? sprintf( ' id="%s"', esc_attr( get_sub_field('section_id') ) ) : '';
// Construct class
$class = !empty( get_sub_field('section_class') ) ? sprintf( ' class="my_custom_class %s"', esc_attr( get_sub_field('section_class') ) ) : ' class="my_custom_class';
// Construct style
$bg_image = get_sub_field('section_background_image');
$bg_color = get_sub_field('section_background_image');
if( empty( $bg_image ) && empty( $bg_color ) ) {
@bob-moore
bob-moore / site-specific-plugin-sample.php
Created January 22, 2018 00:23
Site Specific Plugin Sample
<?php
/**
* Plugin Name: Site Specific Plugin File
* Plugin URI: https://www.wpcodelabs.com
* Description: Site Specific Plugin for [project_name]
* Version: 1.0.0
* Author: WP Code Labs
* Author URI: http://www.wpcodelabs.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt