Skip to content

Instantly share code, notes, and snippets.

View hellofromtonya's full-sized avatar

Tonya Mork hellofromtonya

View GitHub Profile
@hellofromtonya
hellofromtonya / functions.php
Last active November 16, 2020 19:42
Add After Entry Widget to All Post Types, including Custom Post Types
//* Make sure your child theme has this line in the functions.php file
add_theme_support('genesis-after-entry-widget-area');
add_action( 'genesis_after_entry', 'lunarwp_add_after_entry_widget_area' );
/**
* Display after-entry widget area on the genesis_after_entry action hook.
*
* @since 1.0.0
*
* @uses genesis_widget_area() Output widget area.
@hellofromtonya
hellofromtonya / general.php
Created August 9, 2014 16:09
Adds an associative array into the specific position within the original associative array
/**
* Add an associative array into any position within the
* original associative array
*
* @since 1.0.0
*
* @param array $original_array Original Associative array
* @param array $array_to_insert Associative array to insert into the
* original
* @param integer $insert_position Position (starting at index 0) to
@hellofromtonya
hellofromtonya / gist:322c7385bc1a73273d33
Last active August 29, 2015 14:05
Remove columns from WordPress Posts Listing (Admin area)
add_filter('manage_post_posts_columns' , 'lunarwp_remove_some_posts_listing_columns', 20, 1);
/**
* Remove columns from Posts Listing
*
* Uncomment the columns you want to remove
*
* @since 1.0.0
*
* @param array $columns Post Listing Columns
* @return array Returns the amended columns array
@hellofromtonya
hellofromtonya / general.php
Created August 9, 2014 16:59
Add Number of Views to the WordPress Posts Listings' Columns
add_filter('manage_page_posts_columns' , 'lunarwp_core\add_stats_column');
add_filter('manage_post_posts_columns' , 'lunarwp_core\add_stats_column');
/**
* Add Number of Views to the Post Listings' Columns
*
* @since 1.0.0
*
* @param array $columns Post Listing Columns
* @return array Returns the amended columns array
*/
@hellofromtonya
hellofromtonya / general.php
Last active August 29, 2015 14:05
Adds Stats to the New Column within WordPress' Posts & Pages Listings
add_action('manage_page_posts_custom_column', 'lunarwp_core\add_stats_column_render', 10, 2);
add_action('manage_post_posts_custom_column', 'lunarwp_core\add_stats_column_render', 10, 2);
/**
* Add Stats to to the Posts & Pages Listings (in Admin area)
*
* @since 1.0.0
*
* @param array $column Post Listing Columns
* @param integer $post_id Post ID
* @return array Returns the amended columns array
@hellofromtonya
hellofromtonya / functions.php
Last active August 29, 2015 14:05
Add column class to each of the Genesis Footer Widgets
add_filter('genesis_footer_widget_areas', 'lunarwp\add_columns_to_footer_widgets', 10, 2);
/**
* Add column class to each of the footer widgets
*
* @since 1.0.0
*
* @param string $output HTML output for the footer widgets
* @param string $footer_widgets
* @return string Return the amended $output
*/
@hellofromtonya
hellofromtonya / functions.php
Last active August 29, 2015 14:05
Move the Post/Page's Title (entry title) Just After '.site-inner' (Genesis Framework)
//* Remove the entry header from within the loop &
//* place it into a new hook 'lunarwp_entry_header
remove_all_actions('genesis_entry_header');
add_action('lunarwp_entry_header', 'genesis_do_post_format_image', 4);
add_action('lunarwp_entry_header', 'genesis_entry_header_markup_open', 5);
add_action('lunarwp_entry_header', 'genesis_entry_header_markup_close', 15);
add_action('lunarwp_entry_header', 'genesis_do_post_title');
add_action('lunarwp_entry_header', 'genesis_post_info', 12);
add_filter('genesis_markup_site-inner_output', 'lunarwp\do_page_header', 10, 2);
@hellofromtonya
hellofromtonya / functions.php
Last active September 7, 2016 01:46
Gravity Forms - Add new predefined bulk choices (including specifying label and value)
add_filter('gform_predefined_choices', 'lunarwp\add_predefined_choice');
/**
* Add custom Bulk Predefined Choices to Gravity Forms for Regions
*
* @since 1.0.0
*
* @param array $choices Predefined choices array
* @return array Amended array with our new choices added
*/
function add_predefined_choice($choices)
@hellofromtonya
hellofromtonya / hideHeaderNav.js
Last active August 29, 2015 14:06
Hide header nav on homepage until reader begins scrolling down the page - Genesis framework
<script type="text/javascript">
(function($) {
$(document).ready(function () {
var headerNav = $('body.home').find('nav.nav-header');
headerNav.hide();
$(window).scroll(function(){
if ($(this).scrollTop() > 100)
{
@hellofromtonya
hellofromtonya / functions.php
Created October 24, 2014 18:11
Genesis Framework: Swap the Site Description to be before the Site Title
//* Swap the site description ahead of the site title
remove_action('genesis_site_description', 'genesis_seo_site_description');
add_action('genesis_site_title', 'genesis_seo_site_description', 1);