Skip to content

Instantly share code, notes, and snippets.

View hellofromtonya's full-sized avatar

Tonya Mork hellofromtonya

View GitHub Profile
@hellofromtonya
hellofromtonya / home.php
Created January 17, 2017 22:21
Remove each individual Genesis site footer callback
<?php
/**
* Posts Page (Home) template
*
* @package KnowTheCode
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GNU-2.0+
*/
@hellofromtonya
hellofromtonya / functions.php
Last active January 17, 2017 22:29
Strategy 4 - Remove the Genesis site footer for multiple pages
// put this function at the bottom of your theme's
// function.php file
add_action( 'genesis_before_footer', 'prefix_remove_site_footer_from_specific_pages' );
/**
* Remove the site footer from the specified pages.
*
* @since 1.0.0
*
* @return void
@hellofromtonya
hellofromtonya / footer.php
Created January 17, 2017 21:48
Remove the Genesis Site Footer from Multiple Pages - Prefix approach
@hellofromtonya
hellofromtonya / footer.php
Created January 17, 2017 21:40
Genesis remove site footer using a reusable function
@hellofromtonya
hellofromtonya / bootstrap.php
Created January 4, 2017 22:14
Constants for Collapsible Content Plugin
define( 'COLLAPSIBLE_CONTENT_PLUGIN', __FILE__ );
define( 'COLLAPSIBLE_CONTENT_DIR', plugin_dir_path( __FILE__ ) );
$plugin_url = plugin_dir_url( __FILE__ );
if ( is_ssl() ) {
$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
}
define( 'COLLAPSIBLE_CONTENT_URL', $plugin_url );
define( 'COLLAPSIBLE_CONTENT_TEXT_DOMAIN', 'collapsible_content' );
@hellofromtonya
hellofromtonya / jquery.plugin.js
Created January 4, 2017 19:24
Basic Collapsible Content jQuery Script Structure
;(function($, window, document, undefined){
'use strict';
var $qaQuestions, $qaAnswers, $qaIcons,
$teaserMessages, $teaserHiddenContents, $teaserIcons;
var init = function() {
$qaQuestions = $('.qa--question');
$qaAnswers = $qaQuestions.next();
$qaIcons = $qaQuestions.find('.qa--icon');
@hellofromtonya
hellofromtonya / add_shortcode.php
Created January 4, 2017 03:22
add_shortcode example
add_shortcode( 'faq', 'process_the_faq_shortcode' );
/**
* Process the FAQ Shortcode to build a list of FAQs.
*
* @since 1.0.0
*
* @param array|string $user_defined_attributes User defined attributes for this shortcode instance
* @param string|null $content Content between the opening and closing shortcode elements
* @param string $shortcode_name Name of the shortcode
*
@hellofromtonya
hellofromtonya / post.php
Created December 16, 2016 21:04
remove a callback hook using a shortcut strategy
add_action( 'genesis_entry_header', 'remove_post_byline', 9999 );
/**
* Remove the post metadata byline from the HTML markup.
*
* @since 1.0.0
*
* @return void
*/
function remove_post_byline() {
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
@hellofromtonya
hellofromtonya / post.php
Created December 16, 2016 19:04
remove the byline
add_action( 'loop_start', 'remove_post_byline' );
/**
* Remove the post metadata byline from the HTML markup.
*
* @since 1.0.0
*
* @return void
*/
function remove_post_byline() {
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
@hellofromtonya
hellofromtonya / body-classes.php
Last active December 15, 2016 19:48
WordPress `get_body_class` function
function get_body_class( $class = '' ) {
$classes = array();
// build all of the classes
// .. omitted for brevity
$classes = apply_filters( 'body_class', $classes, $class );
return array_unique( $classes );