Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fjarrett's full-sized avatar

Frankie Jarrett fjarrett

View GitHub Profile
@fjarrett
fjarrett / gist:1368339
Created November 15, 2011 21:05
Remove WP Version (from Everywhere)
<?php
function wpized_remove_wp_version() {
return null;
}
add_filter('the_generator', 'wpized_remove_wp_version');
?>
@fjarrett
fjarrett / gist:1726870
Created February 3, 2012 01:10
Auto-Tagging with Author Username
<?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 February 27, 2012 21:31
List skills for Jamie
<?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 March 16, 2012 20:09
Post List Shortcode Parameter Reference
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 13:43
Antioch Child Theme setup for Jake
/*
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 October 4, 2015 14:28
Add prefixes to WordPress post types when a theme is activated
<?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 April 4, 2019 00:31
How to hide your WordPress version number…completely
<?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 23:07
Urban City Child Theme setup for Joe
/*
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 18:51
Urban City Child Theme example
/*
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 December 15, 2015 07:38
Restricts certain menu items from appearing the WordPress Admin area. Useful for hiding unused features such as Posts or Comments from non-Administrator users.
<?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.