Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

John Bunka JohnBunka

🎯
Focusing
View GitHub Profile
@JohnBunka
JohnBunka / function.php
Created Feb 5, 2013
Remove admin management elements of your site using the Genesis Framework.
View function.php
<?php
// Remove Genesis in-post SEO Settings
remove_action( 'admin_menu', 'genesis_add_inpost_seo_box' );
// Remove Genesis Layout Settings
remove_theme_support( 'genesis-inpost-layouts' );
// Remove Genesis menu link
remove_theme_support( 'genesis-admin-menu' );
View default-author.php
<?php
/*
Plugin Name: Default Author
Plugin URI: http://pmg.co
Description: Set a default author for all posts and pages
Version: 1.0
Text Domain: default-author
Author: Christopher Davis
Author URI: http://christopherdavis.me
License: GPL2
@JohnBunka
JohnBunka / embed-pdf-google-viewer.php
Created Aug 16, 2013
Embed PDFs with Google PDF viewer
View embed-pdf-google-viewer.php
<iframe src="http://docs.google.com/gview?url=http://example.com/mypdf.pdf&embedded=true" style="width:100%; height:1000px;" frameborder="0"></iframe>
@JohnBunka
JohnBunka / iframe.php
Created Aug 22, 2013
Force the iframe webpage to not break out
View iframe.php
<iframe src="url" sandbox="allow-forms allow-scripts"></iframe>
@JohnBunka
JohnBunka / function.php
Last active Aug 29, 2015
Add a Dropdown Indicator to a Genesis Navigation Menu Automatically with Font Awesome
View function.php
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' );
}
@JohnBunka
JohnBunka / functions.php
Last active Aug 29, 2015
WordPress: Remove Admin Bar For Subscribers
View functions.php
//* NOTE: Add to functions.php or to a functionality plugin
//*Remove Admin Bar For Subscribers
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
@JohnBunka
JohnBunka / gist:f58858ccb3e9204b8117
Created May 1, 2014
Remove WordPress Admin Links Menu
View gist:f58858ccb3e9204b8117
//* NOTE: Add to functions.php or to a functionality plugin
//* Remove Links Menu
add_action( 'admin_menu', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
remove_menu_page('link-manager.php');
}
@JohnBunka
JohnBunka / gist:99a193404fcc3c2db3bd
Created Feb 23, 2015
Gravity Wiz // Gravity Forms Unrequire Required Fields for Testing
View gist:99a193404fcc3c2db3bd
<?php
/**
* Gravity Wiz // Gravity Forms Unrequire Required Fields for Testing
*
* When bugs pop up on your forms, it can be really annoying to have to fill out all the required fields for every test
* submission. This snippet saves you that hassle by unrequiring all required fields so you don't have to fill them out.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
@JohnBunka
JohnBunka / style.css
Created May 12, 2015
CSS used to customize the Simple Social Icons plugin to match the brand colors of each social network.
View style.css
/* Simple Social Icons
--------------------------------------------- */
.simple-social-icons li.social-dribbble a {
border: 2px solid #ea4c89 !important;
color: #ea4c89 !important;
}
.simple-social-icons li.social-dribbble a:hover {
background-color: #ea4c89 !important;