Skip to content

Instantly share code, notes, and snippets.


John Bunka JohnBunka

View GitHub Profile
JohnBunka / additional-or-custom-css.css
Last active Oct 2, 2017
How to create a fixed Top Bar Menu in Beaver Builder
View additional-or-custom-css.css
Add this to the Additional CSS area in the customizer or to the style.css in your child theme - More info and help at
or on the blog post
.fl-page-bar {
position: fixed;
width: 100%;
z-index: 999;
.fl-page-header-fixed {
JohnBunka / wpconfig.php
Last active Jul 21, 2016
Relocate and update WordPress site URLs / Great when moving a site and updating the links
View wpconfig.php
//* Update the URL for the site
View post-info-edit.php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Incoude this in Genesis imple edits or in your functions.php file or in a functionaility plugin.
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
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>
View default-author.php
Plugin Name: Default Author
Plugin URI:
Description: Set a default author for all posts and pages
Version: 1.0
Text Domain: default-author
Author: Christopher Davis
Author URI:
License: GPL2
JohnBunka / function.php
Created Feb 5, 2013
Remove admin management elements of your site using the Genesis Framework.
View function.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 single-portfolio.php
// Do NOT include the opening php tag above
add_action( 'genesis_entry_content', 'jmw_add_envira_gallery_after_content', 15 );
* Add the gallery after the end of the content
function jmw_add_envira_gallery_after_content() {
$gallery = get_post_meta( get_the_ID(), 'gallery' ); // 'gallery' is name of my ACF gallery field
JohnBunka / functions.php
Created Nov 13, 2015
How to Add Font Awesome Icons to Your WordPress Menu without a plugin
View functions.php
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//' );
JohnBunka / mobilemenu-old.php
Last active Sep 16, 2015
Adding the word ‘Menu’ next to the Hamburger icon in Caroline WordPress University Theme
View mobilemenu-old.php
$('.menu-primary').before('<button class="menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to menus
JohnBunka / functions.php
Created Jun 21, 2015
GenesisWP: Display a custom Favicon
View functions.php
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'sp_favicon_filter' );
function sp_favicon_filter( $favicon_url ) {
return '';