';
echo ('Home');
echo " » ";
if (is_single()) {
the_title('');
if (is_single()) {
echo "";
}
} elseif (is_page()) {
echo the_title();
}
}
}
/* WordPress 3.0 Menu Editor ********************************************/
// add menu support and fallback menu if menu doesn't exist
add_action('init', 'wpj_register_menu');
function wpj_register_menu() {
if (function_exists('register_nav_menu')) {
register_nav_menu('wpj-main-menu', __('Main Menu'));
}
}
function wpj_default_menu() {
echo '
';
}
/* Excerpt ********************************************/
/* Make the "read more" link to the post */
function new_excerpt_more($more) {
global $post;
return '
' . 'Read more...' . '';
}
add_filter('excerpt_more', 'new_excerpt_more');
/* Set the excerpt length */
function new_excerpt_length($length) {
return 60;
}
add_filter('excerpt_length', 'new_excerpt_length');
/* Widgets ********************************************/
include_once("includes/function-widgets.php");
/* Theme Options ********************************************/
$themename = "Brightpage";
$shortname = "bright";
$categories = get_categories('hide_empty=0&orderby=name');
$wp_cats = array();
foreach ($categories as $category_list ) {
$wp_cats[$category_list->cat_ID] = $category_list->cat_name;
}
array_unshift($wp_cats, "Choose a category");
$options = array (
array( "name" => $themename." Options",
"type" => "title"),
array( "name" => "General",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Background Color",
"desc" => "Select the background color for the theme",
"id" => $shortname."_background_color",
"type" => "select",
"options" => array("light-gray", "wood-pattern-vertical"),
"std" => "light-gray"),
array( "name" => "Slider Color Scheme",
"desc" => "Select the slider color scheme",
"id" => $shortname."_slider_color",
"type" => "select",
"options" => array("gray", "dark-gray"),
"std" => "gray"),
array( "name" => "Logo URL",
"desc" => "Enter the link to your logo image",
"id" => $shortname."_logo",
"type" => "text",
"std" => ""),
array( "name" => "Custom CSS",
"desc" => "Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: body { color: blue; }",
"id" => $shortname."_custom_css",
"type" => "textarea",
"std" => ""),
array( "name" => "Display Message to IE6 Users?",
"desc" => "If checked, a message will be displayed to IE6 browsers, just above the navigation bar to encourage them to upgrade to utilize the full features of the site.",
"id" => $shortname."_show_ie6message",
"type" => "checkbox",
"std" => "false"),
array( "name" => "Feedburner URL",
"desc" => "Feedburner is a Google service that takes care of your RSS feed. Paste your Feedburner URL here to let readers see it in your website",
"id" => $shortname."_feedburner",
"type" => "text",
"std" => get_bloginfo('rss2_url')),
array( "name" => "Google Analytics Code",
"desc" => "Paste your Google Analytics or other tracking code in this box. This will be automatically added to the header.",
"id" => $shortname."_ga_code",
"type" => "textarea",
"std" => ""),
array( "type" => "close"),
array( "name" => "Home Page - Featured Content Slider",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Activate Featured Content Slider",
"desc" => "Check the box to featured content slider in homepage.",
"id" => $shortname."_activate_slider",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Category for Featured Content Slider in home page",
"desc" => "Choose a category from which featured posts are drawn.",
"id" => $shortname."_feat_cat",
"type" => "select",
"options" => $wp_cats,
"std" => "Choose a category"),
array( "name" => "Amount of Featured Content Slider posts",
"desc" => "Choose the amount of posts of featured content slider.",
"id" => $shortname."_feat_num",
"type" => "text",
"std" => "5"),
array( "type" => "close"),
array( "name" => "Home Page - Intro",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Intro text",
"desc" => "Enter text used in the intro. It can be HTML",
"id" => $shortname."_intro_text",
"type" => "textarea",
"std" => ""),
array( "type" => "close"),
array( "name" => "Bottom Menu",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Activate 3 Column Bottom Menu",
"desc" => "Check the box to activate 3 column bottom menu.",
"id" => $shortname."_activate_bottom_menu",
"type" => "checkbox",
"std" => "true"),
array( "type" => "close"),
array( "name" => "Footer",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Footer text",
"desc" => "Enter text used in the footer. It can be HTML",
"id" => $shortname."_footer_text",
"type" => "textarea",
"std" => ""),
array( "type" => "close"),
array( "name" => "Footer - Networks",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Activate Footer Networks Menu",
"desc" => "Check the box to activate Footer Networks Menu.",
"id" => $shortname."_activate_networks",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Facebook URL",
"desc" => "Paste your Facebook URL here.",
"id" => $shortname."_facebook",
"type" => "text",
"std" => ""),
array( "name" => "Flickr URL",
"desc" => "Paste your Flickr URL here.",
"id" => $shortname."_flickr",
"type" => "text",
"std" => ""),
array( "name" => "LinkedIn URL",
"desc" => "Paste your LinkedIn URL here.",
"id" => $shortname."_linkedin",
"type" => "text",
"std" => ""),
array( "name" => "LastFM URL",
"desc" => "Paste your LastFM URL here.",
"id" => $shortname."_lastfm",
"type" => "text",
"std" => ""),
array( "name" => "My Space URL",
"desc" => "Paste your My Space URL here.",
"id" => $shortname."_myspace",
"type" => "text",
"std" => ""),
array( "name" => "Twitter URL",
"desc" => "Paste your Twitter URL here.",
"id" => $shortname."_twitter",
"type" => "text",
"std" => ""),
array( "name" => "Delicious URL",
"desc" => "Paste your Delicious URL here.",
"id" => $shortname."_delicious",
"type" => "text",
"std" => ""),
array( "name" => "RSS URL",
"desc" => "Paste your RSS URL here.",
"id" => $shortname."_rss",
"type" => "text",
"std" => ""),
array( "name" => "StumbleUpon URL",
"desc" => "Paste your StumbleUpon URL here.",
"id" => $shortname."_stumbleupon",
"type" => "text",
"std" => ""),
array( "name" => "Technorati URL",
"desc" => "Paste your Technorati URL here.",
"id" => $shortname."_technorati",
"type" => "text",
"std" => ""),
array( "type" => "close")
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: admin.php?page=functions.php&saved=true");
die;
}
else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: admin.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');
}
function mytheme_add_init() {
$file_dir=get_template_directory_uri();
wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");
wp_enqueue_script("rm_script", $file_dir."/functions/rm_script.js", false, "1.0");
}
function mytheme_admin() {
global $themename, $shortname, $options;
$i=0;
if ( $_REQUEST['saved'] ) echo ''.$themename.' settings saved.
';
if ( $_REQUEST['reset'] ) echo ''.$themename.' settings reset.
';
?>
To easily use the theme, use the menu below.