Skip to content

Instantly share code, notes, and snippets.

View JohnBunka's full-sized avatar
🎯
Focusing

John Bunka JohnBunka

🎯
Focusing
View GitHub Profile
@JohnBunka
JohnBunka / additional-or-custom-css.css
Last active October 2, 2017 16:36
How to create a fixed Top Bar Menu in Beaver Builder
/*
Add this to the Additional CSS area in the customizer or to the style.css in your child theme - More info and help at www.PressAvenue.com
or on the blog post https://pressavenue.com/create-fixed-top-bar-menu-beaver-builder
*/
.fl-page-bar {
position: fixed;
width: 100%;
z-index: 999;
}
.fl-page-header-fixed {
@JohnBunka
JohnBunka / wpconfig.php
Last active July 21, 2016 18:03
Relocate and update WordPress site URLs / Great when moving a site and updating the links
//* Update the URL for the site https://codex.wordpress.org/Changing_The_Site_URL
update_option('siteurl','http://example.com');
update_option('home','http://example.com');
@JohnBunka
JohnBunka / post-info-edit.php
Created January 9, 2016 23:50
Genesis Post Info
<?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
JohnBunka / iframe.php
Created August 22, 2013 18:37
Force the iframe webpage to not break out
<iframe src="url" sandbox="allow-forms allow-scripts"></iframe>
<?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 / function.php
Created February 5, 2013 23:01
Remove admin management elements of your site using the Genesis Framework.
<?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' );
@JohnBunka
JohnBunka / single-portfolio.php
Created November 20, 2015 23:46
Display Advanced Custom Fields (ACF) in an Envira Gallery. From http://www.jowaltham.com/display-advanced-custom-fields-envira-gallery/
<?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
JohnBunka / functions.php
Created November 13, 2015 23:23
How to Add Font Awesome Icons to Your WordPress Menu without a plugin
//* 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.4.0/css/font-awesome.css' );
}
@JohnBunka
JohnBunka / mobilemenu-old.php
Last active September 16, 2015 16:00
Adding the word ‘Menu’ next to the Hamburger icon in Caroline WordPress University Theme
$('.menu-primary').before('<button class="menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to menus
@JohnBunka
JohnBunka / functions.php
Created June 21, 2015 02:25
Genesis: Display a custom Gravatar
//* Display a custom Gravatar
add_filter( 'avatar_defaults', 'sp_gravatar' );
function sp_gravatar ($avatar) {
$custom_avatar = get_stylesheet_directory_uri() . '/images/gravatar.png';
$avatar[$custom_avatar] = "Custom Gravatar";
return $avatar;
}