Skip to content

Instantly share code, notes, and snippets.

Avatar

Frankie Jarrett fjarrett

View GitHub Profile
@fjarrett
fjarrett / gist:1368339
Created Nov 15, 2011
Remove WP Version (from Everywhere)
View gist:1368339
<?php
function wpized_remove_wp_version() {
return null;
}
add_filter('the_generator', 'wpized_remove_wp_version');
?>
@fjarrett
fjarrett / gist:1726870
Created Feb 3, 2012
Auto-Tagging with Author Username
View gist:1726870
<?php
function wpized_tag_post_with_author_username($post_id) {
if($parent = wp_is_post_revision($post_id)) {
$post_id = $parent;
}
$post = get_post($post_id);
if($post->post_type != 'post') {
return;
}
@fjarrett
fjarrett / gist:1927236
Created Feb 27, 2012
List skills for Jamie
View gist:1927236
<?php if($skills): ?>
<h5>Skill<?php if( count($skills) > 1 ) { echo 's'; } ?></h5>
<ul>
<?php
foreach($skills as $skill) {
echo '<li>' . $skill->name . '</li>';
}
?>
</ul>
<?php endif; ?>
@fjarrett
fjarrett / rogers_radio-post_list-shortcode_params.php
Created Mar 16, 2012
Post List Shortcode Parameter Reference
View rogers_radio-post_list-shortcode_params.php
partial // default: loop,post_list
wrap // default: true (boolean)
wrapper_class // class attribute for the <ul> element
post_status // default: publish
posts_per_page // default: Settings > Reading > Blog pages show at most
paged // default: paged (if shortcode is in a custom page template use paged="page")
offset // number of posts to displace
orderby // default: date
order // default: DESC
p // post ID
@fjarrett
fjarrett / style.css
Created May 10, 2012
Antioch Child Theme setup for Jake
View style.css
/*
Theme Name: Grace Fellowship
Description: Child theme for the Antioch theme by ChurchThemes
Author: Jake Bondurant
Author URI: http://jakebondurant.com
Template: antioch
*/
@import url("../antioch/style.css");
@fjarrett
fjarrett / gist:2653299
Last active Oct 4, 2015
Add prefixes to WordPress post types when a theme is activated
View gist:2653299
<?php
/* Checks to see if new post type names (with prefixes) are being used. If not, then the old
* post type names are converted as long as there aren't conflicting post type names that are
* being registered by other plugins.
*
* @hook {action} after_setup_theme
*/
function fjarrett_prefix_post_types(){
global $wpdb;
@fjarrett
fjarrett / gist:2657482
Last active Apr 4, 2019
How to hide your WordPress version number…completely
View gist:2657482
<?php
/* Hide WP version meta tag from header and generator tag from feeds
* @return null
* @filter the_generator
*/
function fjarrett_remove_wp_version_tag() {
return null;
}
add_filter( 'the_generator', 'fjarrett_remove_wp_version_tag' );
@fjarrett
fjarrett / style.css
Created May 14, 2012
Urban City Child Theme setup for Joe
View style.css
/*
Theme Name: Castleton UMC
Description: Child theme for the Urban City theme by ChurchThemes
Author: Joe Garrison
Author URI: http://castletonumc.org
Template: urbancity
*/
@import url("../urbancity/style.css");
@fjarrett
fjarrett / style.css
Created May 15, 2012
Urban City Child Theme example
View style.css
/*
Theme Name: Your Church Name
Description: Child theme for the Urban City theme by ChurchThemes
Author: Your name
Author URI: http://yourchurchwebsite.org
Template: urbancity
*/
@import url("../urbancity/style.css");
@fjarrett
fjarrett / gist:5224398
Last active Dec 15, 2015
Restricts certain menu items from appearing the WordPress Admin area. Useful for hiding unused features such as Posts or Comments from non-Administrator users.
View gist:5224398
<?php
/**
* Restricts certain menu items from appearing the WP Admin area. Does not
* affect Administrator users.
*
* @action admin_menu
*/
function fjarrett_restrict_admin_menu_items() {
// Don't restrict Administrator users.