Skip to content

Instantly share code, notes, and snippets.

View hellofromtonya's full-sized avatar

Tonya Mork hellofromtonya

View GitHub Profile
@hellofromtonya
hellofromtonya / asset-helpers.php
Created July 12, 2017 01:52
A better version of our code to change the theme's stylesheet URL to the minified one.
<?php
// code left out for brevity
add_filter( 'stylesheet_uri', 'change_theme_stylesheet_uri_to_min_version', 9999, 2 );
/**
* Change the theme's stylesheet URI to minified version when not
* in development/debug mode.
*
* @since 1.0.0
@hellofromtonya
hellofromtonya / asset-helpers.php
Created July 12, 2017 01:30
Asset versioning helpers and asset loader for Twenty Seventeen theme
<?php
/**
* Asset versioning helpers and asset loader
*
* @package Twenty Seventeen
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GNU-2.0+
*/
@hellofromtonya
hellofromtonya / asset-helpers.php
Last active July 12, 2017 00:40
Loading the theme's minified stylesheet
<?php
// code left out for brevity
add_filter( 'stylesheet_uri', 'change_theme_stylesheet_uri_to_min_version', 9999, 2 );
/**
* Change the theme's stylesheet URI to minified version when not
* in development/debug mode.
*
* @since 1.0.0
*
@hellofromtonya
hellofromtonya / asset-helpers.php
Created July 11, 2017 01:28
Better Asset Versioning - Genesis Child Theme - Versioning
<?php
/**
* Assets loader and helpers
*
* @package Genesis Sample Theme
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GNU-2.0+
*/
@hellofromtonya
hellofromtonya / asset-helpers.php
Created July 11, 2017 00:31
Twenty Seventeen Theme - Better Version Control
<?php
/**
* Asset Loaders and Helpers for Twenty Seventeen Theme
*
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GNU-2.0+
*/
@hellofromtonya
hellofromtonya / remove-cpt-post-title.php
Created June 16, 2017 16:23
Remove the post title for a custom post type
add_filter( 'genesis_post_title_output', 'remove_single_custom_post_titles' );
/**
* If this is a single dogs post type, return nothing
* to remove the title from the web page.
*
* @since 1.0.0
*
* @param string $title The Post's Title
*
* @return string
@hellofromtonya
hellofromtonya / post-dummy-content.text
Created May 24, 2017 19:30
Dummy Content for Posts
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in neque nec orci fringilla iaculis in non diam. Cras elementum ut neque in dignissim. Mauris consequat, diam non hendrerit aliquam, tortor orci accumsan libero, eget finibus erat diam ac massa. Morbi faucibus, est non mattis mattis, dui purus euismod mi, sed iaculis felis metus et libero. Phasellus at sem luctus, laoreet mauris et, semper turpis. Donec at laoreet purus, ut porta sem. Morbi pretium lacus sit amet tortor fermentum, non pulvinar tortor ornare. Nullam faucibus nunc a lorem vulputate, quis vehicula justo fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Ut aliquet condimentum mattis. Aliquam aliquam eros in auctor rutrum. Suspendisse venenatis mollis est, vel tincidunt purus malesuada nec. Nam erat erat, varius et commodo vitae, porta quis dui. Nam placerat sapien sapien, pulvinar tincidunt metus placerat eu.
<!--more-->
Cras efficitur sagittis diam sit amet pellentesque. Nam ac nisl sit
@hellofromtonya
hellofromtonya / portfolio-details-metabox.php
Last active April 17, 2019 02:19
Portfolio Details Metabox example
<?php
/**
* Portfolio Details Metabox Handler
*
* @package KnowTheCode\Portfolio\Metabox
* @since 1.0.0
* @author hellofromTonya
* @link https://KnowTheCode.io
* @license GPL-2.0+
*/
@hellofromtonya
hellofromtonya / functions.php
Created April 5, 2017 14:52
Change the CreativeWork itemtype microdata - Genesis.
<?php
// ..code removed for brevity.
add_filter( 'genesis_attr_entry', 'change_creative_work_itemtype', 15 );
/**
* Change the CreativeWork itemtype.
*
* @since 1.0.0
*
@hellofromtonya
hellofromtonya / before-structural-wrap.php
Created March 24, 2017 18:40
Insert HTML before the Genesis structural wrap for the given contextual area.
add_action( 'genesis_meta', 'process_structural_wrap_handler' );
/**
* Process the structural wrap handler.
*
* @since 1.0.0
*
* @return void
*/
function process_structural_wrap_handler() {
/**