Skip to content

Instantly share code, notes, and snippets.

@jaredatch
jaredatch / gist:6085445
Last active December 20, 2015 06:19
Remove extra metaboxes when editing the "Home" page
<?php
/**
* Remove metaboxes we don't need when editing the "Home" page
*
* @since 1.0.0
*/
function ja_home_remove_metaboxes() {
// Replace 1206 with home post ID
if ( isset( $_GET['post'] ) && $_GET['post'] == '1206' ) {
remove_meta_box( 'genesis_inpost_seo_box', 'page', 'normal');
@ramiabraham
ramiabraham / basic wp-login.php and wp-admin customization
Last active December 17, 2015 09:39
Some wp-login.php and wp-admin customization examples
<?php
/*
* Here are some basic WordPress admin customizations.
*/
// load a custom stylesheet for wp-login.php
function neato_prefix_custom_login_stylesheet() {
wp_enqueue_style( 'custom_login_stylesheet', get_template_directory_uri() . '/css/login.css' );
}
@jaredatch
jaredatch / gist:3764381
Last active October 10, 2015 22:58
Customize image size used in the loop by Genesis
<?php
/**
* Customize image size used in the loop by Genesis
*
* @author Jared Atchison
* @link http://jaredatchison.com/code/
* @param string $image_size
* @global array $wp_query
* @global int $loop_counter
* @return string
@ramseyp
ramseyp / character-cleanup.sql
Created July 5, 2012 17:00
Clean up malformed characters in WordPress database
## Run this in phpMyadmin
##
## Cleans up Posts table
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“');
UPDATE wp_posts SET post_content = REPLACE(post_content, '”', '”');
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’');
UPDATE wp_posts SET post_content = REPLACE(post_content, '‘', '‘');
UPDATE wp_posts SET post_content = REPLACE(post_content, '—', '–');
UPDATE wp_posts SET post_content = REPLACE(post_content, '–', '—');
UPDATE wp_posts SET post_content = REPLACE(post_content, '•', '-');
@billerickson
billerickson / functions.php
Created March 22, 2012 20:57
Automatically Display Author Box
<?php
// Display Author box on Single and Archive
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
add_filter( 'get_the_author_genesis_author_box_archive', '__return_true' );
@billerickson
billerickson / gist:1325548
Last active October 14, 2016 08:11
Use Custom Avatar if Provided
<?php
/**
* Use Custom Avatar if Provided
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-custom-avatar/
*
*/
function be_gravatar_filter($avatar, $id_or_email, $size, $default, $alt) {
// If provided an email and it doesn't exist as WP user, return avatar since there can't be a custom avatar
@billerickson
billerickson / gist:1325546
Last active September 5, 2024 01:27
Custom Avatar Field
<?php
/**
* Add Custom Avatar Field
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-custom-avatar/
*
* @param object $user
*/
function be_custom_avatar_field( $user ) { ?>
<h3>Custom Avatar</h3>