Skip to content

Instantly share code, notes, and snippets.

View tomfinitely's full-sized avatar

Tom Finley tomfinitely

View GitHub Profile
//Enqueue the Dashicons script
add_action( 'wp_enqueue_scripts', 'amethyst_enqueue_dashicons' );
function amethyst_enqueue_dashicons() {
wp_enqueue_style( 'amethyst-dashicons-style', get_stylesheet_directory_uri(), array('dashicons'), '1.0' );
}
// Optional Custom entry meta in entry header - remove "by""
add_filter( 'genesis_post_info', 'amethyst_filter_post_info' );
function amethyst_filter_post_info($post_info) {
$post_info = '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
//* Position post info above post title
remove_action( 'genesis_entry_header', 'genesis_post_info', 12);
add_action( 'genesis_entry_header', 'genesis_post_info', 9 );
@mgburns
mgburns / bu-versions-wp-seo.php
Last active January 3, 2016 06:39
Adds support for post excerpt and WordPress SEO meta fields to alternate versions
<?php
/*
Plugin Name: BU Versions - WordPress SEO Support
Description: Adds support for post excerpt and WordPress SEO meta fields to alternate versions
*/
/**
* Required as the WordPress SEO plugin doesn't use post type support, and BU Versions requires it.
*/
function wpseo_feature_support() {
@nciske
nciske / default-template.php
Created January 2, 2014 20:25
Default page template for The Events Calendar and Genesis 1.9 themes.
<?php
/**
* Default Events Template for Genesis
* This file is the basic wrapper template for all the views if 'Default Events Template'
* is selected in Events -> Settings -> Template -> Events Template.
*
* @package TribeEventsCalendar
* @since 3.0
* @author Modern Tribe Inc. | Tweaked by Thought Refinery
*
@thomasgriffin
thomasgriffin / gist:8012662
Last active December 31, 2015 16:19
REMOVE ALL THE METABOXES FROM ALL THE THINGS. WARNING: THIS THING IS VERY AGGRESSIVE.
<?php
add_action( 'add_meta_boxes', 'tgm_remove_all_the_metaboxes', 100 );
/**
* Removes all metaboxes except the ones I WANT ON MY POST TYPE. RAGE.
*
* This assumes a specific post type. In my case, it is 'envira'.
* This function is very aggressive and removes every single metabox minus
* the needed submitdiv metabox (which allows you to publish something) and
* the metaboxes that I register with my plugin.
*
@coreymcollins
coreymcollins / admin-widgets.js
Last active December 30, 2015 12:09
Share Sidebars Across a Multisite Network
jQuery(document).ready(function($){
function wds_reset_footer_transient() {
// Run our AJAX call to delete our site transient
$.ajax({
type : 'post',
dataType : 'json',
url : ajaxurl,
data : {
@mustardBees
mustardBees / functions.php
Last active October 4, 2024 13:37
Filter a few parameters into WordPress YouTube oEmbed requests. Enable modest branding which hides the YouTube logo. Remove the video title and uploader information. Prevent related videos from being shown once the video has played.
<?php
/**
* Filter a few parameters into YouTube oEmbed requests
*
* @link http://goo.gl/yl5D3
*/
function iweb_modest_youtube_player( $html, $url, $args ) {
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html );
}
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 );
@nutsandbolts
nutsandbolts / (Force excerpts on Genesis search results (functons.php)
Last active January 9, 2019 20:06 — forked from srikat/functions.php
Forces Genesis search results to display excerpts no matter what options are chosen in the theme archive settings. Props to @srikat for this one!
add_action( 'genesis_before_loop', 'sk_excerpts_search_page' );
function sk_excerpts_search_page() {
if ( is_search() ) {
add_filter( 'genesis_pre_get_option_content_archive', 'sk_show_excerpts' );
}
}
function sk_show_excerpts() {
return 'excerpts';
}
add_filter( 'genesis_get_image_default_args', 'prefix_stop_auto_featured_image' );
function prefix_stop_auto_featured_image( $args ) {
if ( ! isset( $args['context'] ) || 'archive' !== $args['context'] )
return $args;
$args['fallback'] = false;
return $args;
}
@GaryJones
GaryJones / readme.md
Last active July 14, 2019 20:46
Custom Featured Post Widget plugin: Skeleton for amending the output of the Genesis Featured Post widget.