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 / 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 / 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 / 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' );
<?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 / 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>
@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 / 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 / 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 / functions-plugin.php
Created October 12, 2017 22:54
Move the Yoast SEO Meta Box to the Bottom of the edit screen in WordPress
/*-------------------------------------
Move the Yoast SEO Meta Box to the Bottom of the edit screen in WordPress
---------------------------------------*/
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@JohnBunka
JohnBunka / functions.php
Created April 11, 2018 17:11
WooCommerce - Removing Tabs
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
}