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 / 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 / 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
<i class="fa fa-spinner fa-spin"></i>
<i class="fa fa-circle-o-notch fa-spin"></i>
<i class="fa fa-refresh fa-spin"></i>
<i class="fa fa-cog fa-spin"></i>
<i class="fa fa-spinner fa-pulse"></i>
<i class="fa fa-quote-left fa-3x fa-pull-left fa-border"></i>
...tomorrow we will run faster, stretch out our arms farther...
And then one fine morning— So we beat on, boats against the
current, borne back ceaselessly into the past.
<ul class="fa-ul">
<li><i class="fa-li fa fa-check-square"></i>List icons</li>
<li><i class="fa-li fa fa-check-square"></i>can be used</li>
<li><i class="fa-li fa fa-spinner fa-spin"></i>as bullets</li>
<li><i class="fa-li fa fa-square"></i>in lists</li>
</ul>
<div class="list-group">
<a class="list-group-item" href="#"><i class="fa fa-home fa-fw"></i>&nbsp; Home</a>
<a class="list-group-item" href="#"><i class="fa fa-book fa-fw"></i>&nbsp; Library</a>
<a class="list-group-item" href="#"><i class="fa fa-pencil fa-fw"></i>&nbsp; Applications</a>
<a class="list-group-item" href="#"><i class="fa fa-cog fa-fw"></i>&nbsp; Settings</a>
</div>
<i class="fa fa-camera-retro fa-lg"></i> fa-lg
<i class="fa fa-camera-retro fa-2x"></i> fa-2x
<i class="fa fa-camera-retro fa-3x"></i> fa-3x
<i class="fa fa-camera-retro fa-4x"></i> fa-4x
<i class="fa fa-camera-retro fa-5x"></i> fa-5x