Skip to content

Instantly share code, notes, and snippets.

View JohnBunka's full-sized avatar
🎯
Focusing

John Bunka JohnBunka

🎯
Focusing
View GitHub Profile
@surefirewebserv
surefirewebserv / simple-social-centered.css
Last active August 31, 2023 15:51
Center Simple Social Icons when doing responsive styles
/* Align Simple Social Icons Centered */
.simple-social-icons ul.alignright,
.simple-social-icon ul.alignleft {
text-align: center;
}
.simple-social-icons ul.alignright li,
.simple-social-icons ul.alignleft li {
display: inline-block;
float: none;
@glueckpress
glueckpress / px-rem-cheat-sheet.css
Created May 26, 2013 16:17
Cheat sheet for rem-calculations based upon 14px and 16px.
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem
@chrisguitarguy
chrisguitarguy / default-author.php
Created July 2, 2012 20:07
Set a default author for posts on your WordPress site.
<?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
@rxnlabs
rxnlabs / php-wp-add-tinymce-button.php
Last active July 2, 2022 15:28
WordPress - Add button to TinyMCE editor in WordPress. Great for creating menus so users can add shortcodes without having to remember the syntax
<?php
/*Add this code to your functions.php file of current theme OR plugin file if you're making a plugin*/
//add the button to the tinymce editor
add_action('media_buttons_context','add_my_tinymce_media_button');
function add_my_tinymce_media_button($context){
return $context.=__("
<a href=\"#TB_inline?width=480&inlineId=my_shortcode_popup&width=640&height=513\" class=\"button thickbox\" id=\"my_shortcode_popup_button\" title=\"Add My Shortcode\">Add My Shortcode</a>");
}
@JPry
JPry / remove-wpe-info.php
Last active January 19, 2022 20:52
Remove WP Engine info from WP Dashboard
<?php
// Remove all evidence of WP Engine from the Dashboard, unless the logged in user is "wpengine"
$user = wp_get_current_user();
if ( $user->user_login != 'wpengine' ) {
add_action( 'admin_init', 'jpry_remove_menu_pages' );
add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 );
}
/**
@bradonomics
bradonomics / year-archive-template.php
Last active January 23, 2021 18:26
Genesis Page Template displaying posts by year. Inspired by Alex Sexton's blog archives: https://alexsexton.com/blog/archives/ and built using code modified from Joe Mar Aparecio: http://www.joemaraparecio.com/customizing-genesis-archive-template-display-posts-month/
<?php
/**
*
* Custom Blog Loop for Bradonomics.
*
* Template Name: Bradonomics Blog
*
*/
//* Remove standard post content output
@robincornett
robincornett / functions-alt.php
Last active November 8, 2016 23:32
Make Simple Social Icons a little more awesome with FontAwesome.
<?php
// do NOT include the opening tag
add_filter( 'simple_social_default_glyphs', 'rgc_simple_social_icons_glyphs' );
function rgc_simple_social_icons_glyphs( $glyphs ) {
$glyphs = array(
'bloglovin' => '<span class="fa fa-heart"></span><span class="screen-reader-text">Bloglovin</span>',
'dribbble' => '<span class="fa fa-dribbble"></span><span class="screen-reader-text">Dribbble</span>',
'email' => '<span class="fa fa-envelope"></span><span class="screen-reader-text">Email</span>',
@ericakfranz
ericakfranz / genesis-facebook-sdk.php
Created November 24, 2015 23:39
Easily include the Facebook SDK script, useful when adding Facebook Social Plugins to your site: https://developers.facebook.com/docs/plugins
<?php
/**
* Plugin Name: Genesis - Facebook SDK
* Plugin URI: https://fatpony.me/
* Description: Adds the Facebook SDK script just after the opening <body> tag on Genesis Framework sites.
* Version: 1.0.0
* Author: Erica Franz
* Author URI: https://fatpony.me/
* License: GPL2
*/
@rfair404
rfair404 / gist:4150286
Created November 26, 2012 20:04
Rip off the Agentpress Listings Widget to enable Keyword Search
/**
* This widget presents a search widget which uses listings' taxonomy for search fields.
*
* @package AgentPressTwo
* @since 2.0
* @author Russell Fair
*/
class AgentPressTwo_Listings_Search_Widget extends WP_Widget {
function AgentPressTwo_Listings_Search_Widget() {
@ckpicker
ckpicker / gist:ba9b617afdbdb3867159
Created January 5, 2015 16:08
Events Calendar // Filters to Override Event Label
add_filter( 'tribe_event_label_singular', 'event_display_name' );
function event_display_name() {
return 'XXXX';
}
add_filter( 'tribe_event_label_plural', 'event_display_name_plural' );
function event_display_name_plural() {
return 'XXXXs';
}