This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Limit Your Website Excerpt */ | |
function word_limit($string, $max_words){ | |
$post_words = explode(' ', $string); | |
$count = count($post_words); | |
$post_words = implode(' ', array_slice($post_words, 0, $max_words)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
/* | |
Plugin Name: Genesis Staff Listing | |
Plugin URI: http://orthogonalcreations.com | |
Description: This plugin adds a Staff custom post type and role taxonomy. It also includes templates for displaying the Staff post type. | |
Author: Jon Breitenbucher | |
Author URI: http://orthogonalcreations.com | |
Version: 1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_custom_archive_template($template) { | |
global $wp_query; | |
$object = $wp_query->get_queried_object(); | |
if ( 'gslstaff' == $object->post_type ) { | |
$templates = array(); | |
if ( $object->post_type ) | |
$templates[] = "archive-{$object->post_type}.php"; | |
$templates[] = 'archive.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make sure to order staff on role term pages alphabetically by last name | |
* | |
* @author Jon Breitenbucher <[email protected]> | |
* @version SVN: $Id$ | |
* @param array $query Default query arguments | |
* @return array modified query arguments | |
* | |
* @since 2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Metaboxes | |
* | |
* This file registers any custom metaboxes | |
* | |
* @package mcedc | |
* @author The Pedestal Group <[email protected]> | |
* @copyright Copyright (c) 2012, Medina County Economic Development Corporation | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jb_remove_menus_by_role () { | |
global $menu; | |
global $current_user; | |
$user_roles = $current_user->roles; | |
$user_role = array_shift($user_roles); | |
if($user_role == 'xxx') { | |
$restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins')); | |
end ($menu); | |
while (prev($menu)){ | |
$value = explode(' ',$menu[key($menu)][0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FilesMatch "\.(oga | ogg | m4a | ogv | mp4 | m4v | webm)$" > | |
<IfModule mod_headers.c> | |
Header append Vary User-Agent env=!dont-vary | |
Header append Vary Host env=!dont-vary | |
Header append Vary Accept-Encoding env=!dont-vary | |
</IfModule> | |
</FilesMatch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Child Theme Settings | |
* Requires Genesis 1.8 or later | |
* | |
* This file registers all of this child theme's specific Theme Settings, accessible from | |
* Genesis > Child Theme Settings. | |
* | |
* @package BE Genesis Child | |
* @author Bill Erickson <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class __JB_Options__ { | |
public __construct() | |
{ | |
} | |
public add_menu_page() | |
{ | |
add_options_page('__Menu Name__','__Menu Name___','administrator',__FILE__,array('__JB_Options__','display_options_page'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JB-__Class Name__ extends WP_Widget { | |
function __construct() | |
{ | |
$params = array( | |
'description' => '', | |
'name' => '' | |
); | |
parent::__contruct('','',$params); |
NewerOlder