Skip to content

Instantly share code, notes, and snippets.

@billrobbins
Created August 25, 2014 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billrobbins/b360224a73d3f5e714fb to your computer and use it in GitHub Desktop.
Save billrobbins/b360224a73d3f5e714fb to your computer and use it in GitHub Desktop.
<?php
// For localization
load_theme_textdomain( 'organizedthemes', get_template_directory().'/languages' );
// options framework
if ( !function_exists( 'optionsframework_init' ) ) {
define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );
require_once dirname( __FILE__ ) . '/inc/options-framework.php';
}
// include required files
include(get_template_directory()."/includes/titles.php");
include(get_template_directory()."/includes/images.php");
include(get_template_directory()."/includes/scripts.php");
include(get_template_directory()."/includes/body-tag.php");
include(get_template_directory()."/includes/custom-js.php");
include(get_template_directory()."/includes/custom-css.php");
include(get_template_directory()."/includes/tha-theme-hooks.php");
include(get_template_directory()."/includes/post-types/staff.php");
include(get_template_directory()."/includes/post-types/slides.php");
include(get_template_directory()."/includes/comment-functions.php");
include(get_template_directory()."/includes/custom-meta-boxes/agency.php");
include(get_template_directory()."/includes/widgets.php");
include(get_template_directory()."/includes/widget-video.php");
include(get_template_directory()."/includes/widget-twitter.php");
include(get_template_directory()."/includes/widget-featured-page.php");
include(get_template_directory()."/includes/widget-facebook-like-box.php");
// include organized themes gallery
if(of_get_option('gallery') == 'yes') {
include(get_template_directory()."/includes/lightbox.php");
}
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'organizedthemes' ),
) );
// Post Formats
add_theme_support( 'post-formats', array( 'image', 'gallery', 'video' ) );
add_post_type_support( 'page', 'post-formats' );
// Tripm Excerpt . . .
function organizedthemes_trim($text) {
return rtrim($text,'[...]');
}
add_filter('get_the_excerpt', 'organizedthemes_trim');
// Flush rewrite rules on theme activation
function organizedthemes_flush_rewrite() {
global $pagenow, $wp_rewrite;
if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) )
$wp_rewrite->flush_rules();
}
add_action( 'load-themes.php', 'organizedthemes_flush_rewrite' );
// Go to theme options after theme activated
if ( is_admin() and isset($_GET['activated'] ) and $pagenow == "themes.php" ) {
wp_redirect( 'themes.php?page=options-framework' );
}
// Sets order of staff members in staff-groups
function agency_pre_posts( $query ) {
if ( is_tax( 'staff-group' ) ) {
// displays in post order
$query->set( 'order', 'ASC' );
$query->set( 'orderby', 'menu_order' );
$query->set( 'posts_per_page', -1 );
return;
}
}
add_action( 'pre_get_posts', 'agency_pre_posts', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment