'ffffff',
'border' => 'bc0404',
'text' => '000000',
'link' => 'bc0404',
'url' => '00447c',
);
/**
* Enqueue scripts and styles
*/
function notesil_scripts() {
wp_enqueue_style( 'notesil', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'notesil_scripts' );
function notes_comments( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
extract( $args, EXTR_SKIP );
global $notes_comments_alt;
?>
',
'after_widget' => "\n\t\t\t\n",
'before_title' => "\n\t\t\t\t". '\n"
) );
}
add_action( 'widgets_init', 'notes_sidebar_init' );
// Translate, if applicable
load_theme_textdomain( 'notesil', get_template_directory() . '/languages' );
// Adds filters for the description/meta content in archives.php
add_filter( 'archive_meta', 'wptexturize' );
add_filter( 'archive_meta', 'convert_smilies' );
add_filter( 'archive_meta', 'convert_chars' );
add_filter( 'archive_meta', 'wpautop' );
//Notes color customizer, inspired by Toni's
function get_notes_colors() {
return array(
'default' => 'BC0404',
'black' => '000',
'darkblue' => '213970',
'darkgreen' => '3D750B',
'darkpurple' => '660066',
'grey' => '6B6B6B',
'lightblue' => 'BAC5D2',
'lightgreen' => '749881',
'lightorange' => 'DC6700',
'lightpurple' => '9999CC',
'olive' => '660',
'strongbrown' => '950'
);
}
function get_notes_color() {
$notes_color = get_option( 'notes_color' );
if ( $notes_color == '' )
$notes_color = 'default';
return clean_notes_color( $notes_color );
}
function notes_color_select() {
echo "\n";
}
function notes_color_radios() {
$colors = get_notes_colors();
$current_color = get_notes_color();
$theme_uri = get_template_directory_uri();
$i = 0;
foreach ( $colors as $name => $value ) {
$checked = ( $current_color == $name ) ? " checked='checked'" : '';
echo " | |
|
\n";
++$i;
}
}
function clean_notes_color( $notes_color ) {
$notes_colors = get_notes_colors();
if ( array_key_exists( $notes_color, $notes_colors ) )
return $notes_color;
else
return '';
}
function notes_color() {
echo get_notes_color();
}
function notes_css( $body_class ) {
$notes_color = get_notes_color();
if ( !empty( $notes_color ) )
$body_class[]= $notes_color;
return( $body_class );
}
add_filter( 'body_class', 'notes_css' );
add_action( 'admin_menu', 'notes_add_theme_page' );
function notes_add_theme_page() {
global $notes_message;
if ( isset( $_POST['action']) && 'notes_update' == $_POST['action'] && wp_verify_nonce( $_POST['notesil_nonce'], 'notesil_save_theme_options' ) && current_user_can( 'edit_theme_options' ) ) {
$color = clean_notes_color( $_POST['notes_color'] );
update_option( 'notes_color', $color);
$message = __("Color changed.", 'notesil' );
$notes_message = "";
}
add_theme_page( __( 'Theme Options', 'notesil' ), __( 'Theme Options', 'notesil' ), 'edit_theme_options', 'theme_options', 'notes_theme_page' );
}
function notes_theme_page() {
global $notes_message;
echo $notes_message;
?>
tag based on what is being viewed.
*
* @since NotesIL 0.6
*/
function notes_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'notes' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'notes_wp_title', 10, 2 );