'Sidebar'
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Footer'
));
function new_excerpt_length($length) {
return 15;
}
add_filter('excerpt_length', 'new_excerpt_length');
function getImage($num) {
global $more;
$more = 1;
$content = get_the_content();
$count = substr_count($content, '');
$postOutput = substr($post, 0, $imgEnd+1);
$postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '',$postOutput);;
$image[$i] = $postOutput;
$start=$imgEnd+1;
}
if(stristr($image[$num],'
'.$image[$num].""; }
$more = 0;
}
function the_thumb($size = "medium", $add = "") {
global $wpdb, $post;
$thumb = $wpdb->get_row("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_parent = {$post->ID} AND post_mime_type LIKE 'image%' ORDER BY menu_order");
if(!empty($thumb)) {
$image = image_downsize($thumb->ID, $size);
print "
";
}
}
//Theme Options//
$themename = "Angelia";
$shortname ="ang";
$ang_categories_obj = get_categories('hide_empty=0');
$ang_categories = array();
foreach ($ang_categories_obj as $ang_cat) {
$ang_categories[$ang_cat->cat_ID] = $ang_cat->category_nicename;
}
$categories_tmp = array_unshift($ang_categories, "Select a category:");
$number_entries = array("Select a Number:","1","2","3","4","5","6","7","8","9","10" );
$options = array(
array(
"name" => "Angelia Theme Options" ,
"type" => "title"),
array (
"type" => "open"),
array(
"name" => "General",
"type" => "heading"
),
array(
"name" => "Styles",
"desc" => "Switch Style",
"id" => $shortname."_style",
"type" => "select",
"options" => array("Style1","Style2","Style3","Style4","Style5","Style6","Style7","Style8","Style9","Style10"),
"std" => "Style1",
),
array(
"name" => "BreadCrumbs",
"desc" => "Hide Breadcrumbs?",
"id" => $shortname."_breadcrumbs",
"type" => "checkbox",
"std" => ""
),
array(
"name" => "Homepage",
"type" => "heading"
),
array(
"name" => "Slider Category",
"desc" => "Select the category for slider",
"id" => $shortname."_slider_cat",
"type" => "select",
"std" => "Select a category",
"options" => $ang_categories),
array(
"name" => "Slider Posts Count",
"desc" => "How many posts you want to show in slider?",
"id" => $shortname."_slider_count",
"type" => "select",
"std" => "3",
"options" => $number_entries),
array(
"name" => "Featured Posts Category",
"desc" => "Select the category of featured posts",
"id" =>$shortname."_featured_cat",
"type" => "select",
"std" => "Select a category",
"options" => $ang_categories),
array(
"name" => "Featured Posts count",
"desc" => "How many Featured posts you want to show on homepage?",
"id" => $shortname."_featured_count",
"type" => "select",
"std" => "3",
"options" => $number_entries),
array(
"name" => "Social Icons",
"type" => "heading"
),
array(
"name" => "Hide all the Social Icons",
"id" => $shortname."_hide_social",
"type" => "checkbox",
"std" => ""),
array(
"name" => "Twitter Icon",
"desc" => "Check to hide Twitter icon. If not type your twitter url below:",
"id" => $shortname."_hide_tw",
"type" => "checkbox",
"std" => ""),
array(
"id" => $shortname."_tw_url",
"type" => "text2",
"desc" => "Type Your Twitter URL",
"std" => ""
),
array(
"name" => "Facebook Icon",
"desc" => "Check to hide Facebook icon. If not type your Facebook url below:",
"id" => $shortname."_hide_fb",
"type" => "checkbox",
"std" => ""),
array(
"id" => $shortname."_fb_url",
"type" => "text2",
"desc" => "Type Your Facebook URL",
"std" => ""
),
array(
"name" => "Myspace Icon",
"desc" => "Check to hide Myspace icon. If not type your Myspace url below:",
"id" => $shortname."_hide_ms",
"type" => "checkbox",
"std" => ""),
array(
"id" => $shortname."_ms_url",
"type" => "text2",
"desc" => "Type Your Myspace URL",
"std" => ""
),
array(
"name" => "RSS Feed Icon",
"desc" => "Check to hide Feedburner icon. If not type your Feedburner url below:",
"id" => $shortname."_hide_rss",
"type" => "checkbox",
"std" => ""),
array(
"id" => $shortname."_rss_url",
"type" => "text2",
"desc" => "Type Your Feedburner URL",
"std" => ""
),
array(
"name" => "Footer",
"type" => "heading"
),
array(
"name" => "Footer Text",
"desc" => "Type your own footer text",
"id" => $shortname."_text",
"type" => "textarea",
"std" => "©Angelia 2010"),
array(
"type" => "close"),
array(
"type" => "submit")
);
/*Add a Theme Options Page*/
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: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo '
'.$themename.' settings saved.
'.$themename.' settings reset.