__('Site Navigation','The J A Mortram'),
'donate' => __('Donate','The J A Mortram')
));
}
add_action( 'after_setup_theme', 'jam_theme_setup' );
/**
* add scripts via wp_head()
*
*/
function starkers_script_enqueuer() {
/* open sans from google */
wp_register_style( 'fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,600italic,300,600' );
wp_enqueue_style( 'fonts' );
if ( is_single() ) {
wp_register_script( 'fullscreen', get_template_directory_uri().'/js/jquery.fullscreen-min.js', array( 'jquery' ) );
wp_enqueue_script( 'fullscreen' );
wp_register_script( 'site', get_template_directory_uri().'/js/site.js', array( 'jquery' ) );
wp_enqueue_script( 'site' );
$data = array('stylesheet_directory_uri' => __(get_stylesheet_directory_uri()));
wp_localize_script('site', 'jam_data', $data);
}
wp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css' );
wp_enqueue_style( 'screen' );
}
add_action( 'wp_enqueue_scripts', 'starkers_script_enqueuer' );
/**
* add css class to body
*
*/
add_filter( 'body_class', array( 'Starkers_Utilities', 'add_slug_to_body_class' ) );
/**
* register sidebar
*
*/
function jam_register_sidebar() {
register_sidebar(array(
'name' => __('Footer','The J A Mortram'),
'id' => 'footer-sidebar',
'description' => __('Widgets in this area will be shown in the footer.','The J A Mortram'),
'before_title' => '
',
'after_title' => '
'
));
}
add_action( 'widgets_init', 'jam_register_sidebar' );
/**
* customize the search form
*
*/
function jam_search_form( $form ) {
$form = '';
return $form;
}
add_filter( 'get_search_form', 'jam_search_form' );
/**
* customize protected excerpt
*
*/
function jam_excerpt_protected( $excerpt ) {
if ( post_password_required() )
$excerpt = 'This post is password protected.';
return $excerpt;
}
add_filter( 'the_excerpt', 'jam_excerpt_protected' );
/**
* register site options
*
*/
function jam_validate_options($input) {
global $jam_options;
$settings = get_option( 'jam_options', $jam_options );
// Strip all tags from the text fields, to avoid vulnerablilties like XSS
$input['copyright_statement_footer'] = wp_filter_nohtml_kses( $input['copyright_statement_footer'] );
$input['google_analytics_tracking_id'] = wp_filter_nohtml_kses( $input['google_analytics_tracking_id'] );
return $input;
}
function jam_register_options() {
register_setting( 'jam_theme_options', 'jam_options', 'jam_validate_options' );
}
add_action( 'admin_init', 'jam_register_options' );
/**
* add the ability to set options to the admin screen
*
*/
function jam_admin_theme_options() {
add_theme_page(__('The J A Mortram Options','The J A Mortram'), __('The J A Mortram','The J A Mortram'), 'administrator', 'the-j-a-mortram-options', 'jam_admin_options_page');
}
function jam_admin_options_page() {
global $jam_options, $jam_settings;
if (! isset($_REQUEST['settings-updated'])) {
$_REQUEST['settings-updated'] = false;
} ?>