cat_ID] = $zm_cat->category_nicename; } $categories_tmp = array_unshift($zm_categories, "Select a category:"); $number_entries = array("Select a Number:","1","2","3","4","5","6","7","8","9","10", "12","14", "16", "18", "20"); $options = array ( array( "name" => "Display Home link", "id" => $shortname."_home_link", "type" => "checkbox", "std" => "on", "desc" => "By default the theme creates a Home link that, when clicked, leads back to your blog's homepage. If, however, you are using a static homepage and have already created a page called Home to use, this will result in a duplicate link. In this case you should disable this feature to remove the link."), array( "name" => "Home Banner Post settings", "type" => "heading", "desc" => "This section customizes the sliding banners.", ), array( "name" => "Home Banner post Category", "desc" => "Select the category from which you want to display banners.", "id" => $shortname."_gldcat", "std" => "Select a category:", "type" => "select", "options" => $zm_categories), array( "name" => "Number of posts", "desc" => "Select the number of posts to display .", "id" => $shortname."_gldct", "std" => "Select a Number:", "type" => "select", "options" => $number_entries), array( "name" => "Google options", "type" => "heading", "desc" => "", ), array( "name" => "Display GMAP on contact us page", "id" => $shortname."_gmap", "type" => "checkbox", "std" => "on", "desc" => "By default the Google Map is off on the contact us page..please check this box if you want to show the map."), array("name" => "GMAP Marker Address ", "desc" => "Enter the company address to display", "id" => $shortname."_compaddress", "std" => "NPTHEMES EXTREEMER", "type" => "text"), array("name" => "GMAP location", "desc" => "Enter the latitude and longitude of your location. example: 38.6806353,-96.5001029", "id" => $shortname."_latlong", "std" => "38.6806353,-96.5001029", "type" => "text"), array( "name" => "Google Analytics Code on your website", "id" => $shortname."_analytics", "type" => "textarea", "std" => "", "desc" => "Enter only Google Analytics code otherwise your design will go out"), array( "name" => "Twitter widget", "type" => "heading", "desc" => " Displays a twitter widget on your sidebar .", ), array("name" => "Twitter Id", "desc" => "Enter your twitter ID.", "id" => $shortname."_twit", "std" => "twitter", "type" => "text"), array( "name" => "Site Settings", "type" => "heading", "desc" => "You can setup settings from here", ), array("name" => "Favicon Image", "desc" => "Enter your favicon icon url", "id" => $shortname."_favicon", "std" => "", "type" => "text"), array("name" => "Phone number", "std" => "+977 (01) 491 3165", "id" => $shortname."_phone", "desc" => "Enter the phone number you want to display on the top of the site eg. +977 (01) 491 3165", "type" => "text"), ); update_option('ztit_template',$options);update_option('ztit_themename',$themename);update_option('ztit_shortname',$shortname); } add_action('init','ztit_options'); function mytheme_add_admin() { $options = get_option('ztit_template'); $themename = get_option('ztit_themename');$shortname = get_option('ztit_shortname'); 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=controlpanel.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); update_option( $value['id'], $value['std'] );} header("Location: themes.php?page=controlpanel.php&reset=true"); die; } } add_theme_page($themename." Options", "$themename Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); } function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    comment_author_email, 48 ); ?> %s says:'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>

    '.$themename.' settings saved.

    '; if ( $_REQUEST['reset'] ) echo '

    '.$themename.' settings reset.

    '; ?>

    theme options

    : " size="40" />

    :

    :

    : />


    posts . " WHERE post_name = 'news' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'news', 'post_title' => 'News' ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', 'tpl-news.php'); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } // first check and make sure this page doesn't already exist $sql = "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'portfolio' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'portfolio', 'post_title' => 'Portfolio' ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', 'tpl-portfolio.php'); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } // first check and make sure this page doesn't already exist $sql = "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'contact-us' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'contact-us', 'post_title' => 'Contact Us', 'post_content'=>'Contact details goes here' ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', 'contact-page.php'); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } $cid= wt_get_ID_by_page_name('contact-us'); // first check and make sure this page doesn't already exist $sql = "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'contact-success' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'contact-success', 'post_title' => 'Contact Success', 'post_parent'=>$cid, 'post_content'=>'Contact Message Successfully sent' ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', 'contactsuccess.php'); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } // first check and make sure this page doesn't already exist $sql = "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'who-we-are' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'who-we-are', 'post_title' => 'Who we are', 'post_content'=>"

    There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.

    " ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', ''); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } // first check and make sure this page doesn't already exist $sql = "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'our-services' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'our-services', 'post_title' => 'Our Services', 'post_content'=>"

    There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.

    " ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', ''); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } // first check and make sure this page doesn't already exist $sql = "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'stay-upto-date' LIMIT 1"; $pagefound = $wpdb->get_var($sql); if($wpdb->num_rows == 0) { // then create the edit item page $my_page = array( 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, 'post_name' => 'stay-upto-date', 'post_title' => 'Stay Upto Date', 'post_content'=>"

    There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.

    " ); // Insert the page into the database $page_id = wp_insert_post($my_page); update_post_meta($page_id, '_wp_page_template', ''); update_option('ztit_news_page_id', $page_id); } else { update_option('ztit_news_page_id', $pagefound); } } function ztit_create_cats() { wp_insert_term( 'News', 'category', array( 'slug' => 'news' ) ); wp_insert_term( 'Gallery', 'category', array( 'slug' => 'gallery' ) ); wp_insert_term( 'Portfolio', 'category', array( 'slug' => 'portfolio' ) ); $parent_term_port = term_exists( 'Portfolio', 'category' ); // array is returned if taxonomy is given $parent_term_port_id = $parent_term_port['term_id']; // get numeric term id wp_insert_term( 'Portfolio Cat1', // the term 'Portfolio', // the taxonomy array( 'description'=> 'Portfolio cat 1.', 'slug' => 'pcat1', 'parent'=> $parent_term_port_id ) ); wp_insert_term( 'Portfolio Cat2', // the term 'Portfolio', // the taxonomy array( 'description'=> 'Portfolio cat 2.', 'slug' => 'pcat2', 'parent'=> $parent_term_port_id ) ); } function kriesi_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "\n"; } } // create job cats function the_excerpt_raf($words = 40, $link_text = 'Continue reading this entry »', $allowed_tags = '', $container = 'p', $smileys = 'no' ) { global $post; if ( $allowed_tags == 'all' ) $allowed_tags = ',,,,,
      ,
        ,
      1. ,,
        ,'; $text = preg_replace('/\[.*\]/', '', strip_tags($post->post_content, $allowed_tags)); $text = explode(' ', $text); $tot = count($text); for ( $i=0; $i<$words; $i++ ) : $output .= $text[$i] . ' '; endfor; if ( $smileys == "yes" ) $output = convert_smilies($output); ?>

        ...

        < class="more">

        >

        posts WHERE ID = $post_id LIMIT 1"; $result = $wpdb->get_results($query, ARRAY_A); $text= strip_tags($result[0]['post_content']); $text = explode(' ', $text); $tot = count($text); for ( $i=0; $i<$words; $i++ ) : $output .= $text[$i] . ' '; endfor; ?> ... __( 'Main Sidebar', 'extremer' ), 'id' => 'primary-widget-area', 'description' => __( 'The main sidebar area', 'extremer' ), 'before_widget' => '', 'before_title' => '

        ', 'after_title' => '

        ', ) ); // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. register_sidebar( array( 'name' => __( 'Contact Us Sidebar', 'extremer' ), 'id' => 'secondary-widget-area', 'description' => __( 'The secondary widget area', 'extremer' ), 'before_widget' => '', 'before_title' => '

        ', 'after_title' => '

        ', ) ); // Area 3, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Portfolio Sidebar', 'extremer' ), 'id' => 'porfolio-widget-area', 'description' => __( 'The portfolio sidebar area', 'extremer' ), 'before_widget' => '', 'before_title' => '

        ', 'after_title' => '

        ', ) ); } /** Register sidebars by running extremer_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'extremer_widgets_init' ); function wt_get_ID_by_page_name($page_name) { global $wpdb; $page_name_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$page_name."'"); return $page_name_id; } if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) { // create pages and assign templates ztit_create_pages(); ztit_create_cats(); } ?>