Skip to content

Instantly share code, notes, and snippets.

efuller /
Last active Mar 1, 2017 — forked from kellenmace/output-buffering-example.php
Template tags and Output Buffering at WDS


This exploded into a big discussion about the creation of template tags and why you don’t have to always create a get and a do.

Example, in a loop you run do_my_thing(), the function do_my_thing() does not need to buffer the output if you’re just going to echo it out in the loop, so ob_start is not needed!

If, later, you find you need to get that string you can write a simple getter:

Usually a template tag is wrote as a do first, and then a get later when it’s needed, but either way write your do and get when you need them, don’t build a get for the future unless it will be needed in the future

efuller / functions.php
Created Jan 27, 2017
List WordPress pages using a template.
View functions.php
// source:
$args = array(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'template-two-column-page.php', // the template you want to check
efuller /
Last active Mar 10, 2017
PHP Array isset and empty
efuller / SassMeister-input-HTML.html
Created Apr 6, 2015
Generated by
View SassMeister-input-HTML.html
<div class="container">
<li>block 1</li>
<li>block 2</li>
<li>block 3</li>
<li>block 4</li>
<li>block 5</li>
<li>block 6</li>
<li>block 7</li>
<li>block 8</li>
efuller / front-page.php
Last active Aug 29, 2015
Add text fade effect to Genesis parallax theme.
View front-page.php
add_action( 'wp_enqueue_scripts', 'parallax_enqueue_scripts' );
* Enqueue Scripts
function parallax_enqueue_scripts() {
if ( is_active_sidebar( 'home-section-1' ) ) {
if ( ! wp_is_mobile() ) {