Skip to content

Instantly share code, notes, and snippets.

View hellofromtonya's full-sized avatar

Tonya Mork hellofromtonya

View GitHub Profile
@hellofromtonya
hellofromtonya / post-type.php
Created March 22, 2017 16:03
Runtime configuration for the FAQ custom post type.
<?php
/**
* Runtime configuration for the FAQ custom post type.
*
* @package KnowTheCode\Module\FAQ\Custom
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GNU-2.0+
*/
@hellofromtonya
hellofromtonya / css-handler.php
Created March 16, 2017 19:34
WooCommerce Module for Genesis Sample
<?php
/**
* Adds the CSS from the WooCommerce Module options.
*
* @package KnowTheCode\Developers\WooCommerce
* @since 1.0.0
* @author hellofromTonya
* @link https://knowthecode.io
* @license GNU General Public License 2.0+
*/
@hellofromtonya
hellofromtonya / ternary-examples.php
Created March 13, 2017 18:26
Some PHP ternary examples
<?php
/***************************
* Ternary Examples
**************************/
/**
* Determine whether the given value is array accessible.
*
* @since 1.0.0
@hellofromtonya
hellofromtonya / functions.php
Last active February 19, 2017 17:44
Agency Pro - Change the default Widget Title HTML tag from <h4> to <h2>
add_filter( 'genesis_register_widget_area_defaults', 'agency_pro_change_widget_title_to_h2', 99 );
/**
* Change the Widget Title HTML tag element from a <h4> to <h2>.
*
* @since 1.0.0
*
* @param array $defaults Array of default parameters
*
* @return array
*/
@hellofromtonya
hellofromtonya / wp-config.php
Created February 13, 2017 19:56
Turning on Debug mode in wp-config.php
/**
* When you are building your code (i.e. in development), you should turn on
* all error reporting in wp-config.php. Why? Because you want to find all
* warnings, notices, errors, etc. before you ship it to your client. Even
* the minor errors are telling you something is wrong in the code.
* Suppressing them does not fix the problem. It merely quiets them down.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
@hellofromtonya
hellofromtonya / footer.php
Created January 25, 2017 23:57
prefooter cta widget example
@hellofromtonya
hellofromtonya / taxonomy.php
Created January 20, 2017 00:47
Adding department terms to the Genesis footer entry meta
add_filter( 'genesis_post_meta', __NAMESPACE__ . '\filter_genesis_footer_post_meta' );
/**
* Filter the Genesis Footer Entry Post Meta
* to add the post terms for our custom taxonomy to it.
*
* @since 1.0.0
*
* @param string $post_meta
*
* @return string
@hellofromtonya
hellofromtonya / taxonomy.php
Created January 19, 2017 20:34
Bare minimum to register a custom taxonomy
$args = array(
'label' => __( 'Departments', 'teambios' ),
'hierarchical' => true,
);
register_taxonomy( 'department', 'team-bios', $args );
@hellofromtonya
hellofromtonya / taxonomy.php
Created January 19, 2017 20:28
Registering a custom taxonomy
<?php
/**
* Custom Taxonomy functionality
*
* @package KnowTheCode\TeamBios\Custom
* @since 1.0.0
* @author hellofromTonya
* @link https://knowthecode.io
* @license GNU General Public License 2.0+
*/
@hellofromtonya
hellofromtonya / home.php
Created January 17, 2017 22:43
Strategy 3 - Remove all Genesis footer events
<?php
/**
* Posts Page (Home) template
*
* @package KnowTheCode
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GNU-2.0+
*/