-1,
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'exclude' => $exclude_thumbnail ? array(get_post_thumbnail_id()) : array(),
'orderby' => 'menu_order ID'
)));
}
//ADD FULL WIDTH BODY CLASS
add_filter( 'body_class', 'osiris_fullwdth_body_class');
function osiris_fullwdth_body_class( $classes ) {
if(of_get_option('nosidebar_checkbox') == "1")
$classes[] = 'osiris_fullwdth_body';
return $classes;
}
//Custom Excerpt Length
function osiris_excerptlength_teaser($length) {
return 30;
}
function osiris_excerptlength_index($length) {
return 12;
}
function osiris_excerptmore($more) {
return '...';
}
function osiris_excerpt($length_callback='', $more_callback='') {
global $post;
if(function_exists($length_callback)){
add_filter('excerpt_length', $length_callback);
}
if(function_exists($more_callback)){
add_filter('excerpt_more', $more_callback);
}
$output = get_the_excerpt();
$output = apply_filters('wptexturize', $output);
$output = apply_filters('convert_chars', $output);
$output = '
'.$output.'
';
echo $output;
}
/*-----------------------------------------------------------------------------------*/
/* Display tag
/*-----------------------------------------------------------------------------------*/
// filter function for wp_title
function osiris_filter_wp_title( $old_title, $sep, $sep_location ){
// add padding to the sep
$ssep = ' ' . $sep . ' ';
// find the type of index page this is
if( is_category() ) $insert = $ssep . __('Category','osiris');
elseif( is_tag() ) $insert = $ssep . __('Tag','osiris');
elseif( is_author() ) $insert = $ssep . __('Author','osiris');
elseif( is_year() || is_month() || is_day() ) $insert = $ssep . __('Archives','osiris');
elseif( is_home() ) $insert = $ssep . get_bloginfo('description');
else $insert = NULL;
// get the page number we're on (index)
if( get_query_var( 'paged' ) )
$num = $ssep . __('Page ','osiris') . get_query_var( 'paged' );
// get the page number we're on (multipage post)
elseif( get_query_var( 'page' ) )
$num = $ssep . __('Page ','osiris') . get_query_var( 'page' );
// else
else $num = NULL;
// concoct and return new title
return get_bloginfo( 'name' ) . $insert . $old_title . $num;
}
add_filter( 'wp_title', 'osiris_filter_wp_title', 10, 3 );
function osiris_rss_title($title) {
/* need to fix our add a | blog name to wp_title */
$ft = str_replace(' | ','',$title);
return str_replace(get_bloginfo('name'),'',$ft);
}
add_filter('get_wp_title_rss', 'osiris_rss_title',10,1);
//SIDEBAR
function osiris_widgets_init(){
register_sidebar(array(
'name' => __('Right Sidebar', 'osiris'),
'id' => 'sidebar',
'description' => __('Right Sidebar', 'osiris'),
'before_widget' => '',
'before_title' => ''
));
register_sidebar(array(
'name' => __('Footer Widgets', 'osiris'),
'id' => 'foot_sidebar',
'description' => __('Widget Area for the Footer', 'osiris'),
'before_widget' => '',
'before_title' => ''
));
register_sidebar(array(
'name' => __('Home Page Services', 'osiris'),
'description' => __('This widget area is designed to display up to 4 services widgets.', 'osiris'),
'id' => 'homepage-sidebar',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
//Register widgets
register_widget( 'osiris_contact_widget' );
register_widget( 'osiris_recent_widget' );
register_widget( 'osiris_services_widget' );
}
add_action( 'widgets_init', 'osiris_widgets_init' );
include(get_template_directory() . "/lib/recent-posts-widget.php");
include(get_template_directory() . "/lib/contact-widget.php");
include(get_template_directory() . "/lib/services-widget.php");
//**************Osiris SETUP******************//
function osiris_setup() {
//Custom Background
add_theme_support( 'custom-background', array(
'default-color' => '',
'default-image' => get_template_directory_uri() . ''
) );
add_theme_support('automatic-feed-links');
//Post Thumbnail
add_theme_support( 'post-thumbnails' );
//Register Menus
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'osiris' ),
'footer' => __( 'Footer Navigation', 'osiris' )
) );
// Enables post and comment RSS feed links to head
add_theme_support('automatic-feed-links');
// Localisation Support
load_theme_textdomain('osiris', get_template_directory() . '/languages');
$locale = get_locale();
$locale_file = get_template_directory() . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
/*
* Loads the Options Panel
*/
/* Set the file path based on whether we're in a child theme or parent theme */
if ( get_stylesheet_directory() == get_template_directory_uri() ) {
define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
} else {
define('OPTIONS_FRAMEWORK_URL', get_stylesheet_directory() . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
}
require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
}
add_action( 'after_setup_theme', 'osiris_setup' );
?>