__( 'Primary Menu' ), 'secondary-menu' => __( 'Secondary Menu' ) ) ); } } } /******************************* TOP COMMENTERS ********************************/ function top_comment_authors($amount = 5){ global $wpdb; $results = $wpdb->get_results(' SELECT COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url FROM '.$wpdb->comments.' WHERE comment_author_email != "" AND comment_type = "" AND comment_approved = 1 GROUP BY comment_author_email ORDER BY comments_count DESC, comment_author ASC LIMIT '.$amount ); $output = ""; echo $output; } /******************************* JQUERY ENQUEUE ********************************/ add_action('wp_enqueue_scripts', 'get_my_scripts'); function get_my_scripts() { if (!is_admin()) wp_deregister_script('jquery'); wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, ''); wp_enqueue_script('jquery'); wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery')); wp_enqueue_script('jquerytools', get_template_directory_uri() . '/js/jquery.tools.min.js', array('jquery')); wp_enqueue_script('jquery-ui-person', get_template_directory_uri() . '/js/jquery-ui-personalized-1.5.2.packed.js', array('jquery')); wp_enqueue_script('jquery-ui-person', get_template_directory_uri() . '/js/jquery.form.js', array('jquery')); wp_enqueue_script('sprinkle', get_template_directory_uri() . '/js/sprinkle.js', array('jquery', 'jquery-ui-person', 'jquery-ui-tabs')); } /******************************* TWITTER COUNTER ********************************/ function rarst_twitter_user( $username, $field, $display = false ) { $interval = 3600; $cache = get_option('rarst_twitter_user'); $url = 'http://api.twitter.com/1/users/show.json?screen_name='.urlencode($username); if ( false == $cache ) $cache = array(); // if first time request add placeholder and force update if ( !isset( $cache[$username][$field] ) ) { $cache[$username][$field] = NULL; $cache[$username]['lastcheck'] = 0; } // if outdated if( $cache[$username]['lastcheck'] < (time()-$interval) ) { // holds decoded JSON data in memory static $memorycache; if ( isset($memorycache[$username]) ) { $data = $memorycache[$username]; } else { $result = wp_remote_retrieve_body(wp_remote_request($url)); $data = json_decode( $result ); if ( is_object($data) ) $memorycache[$username] = $data; } if ( is_object($data) ) { // update all fields, known to be requested foreach ($cache[$username] as $key => $value) if( isset($data->$key) ) $cache[$username][$key] = $data->$key; $cache[$username]['lastcheck'] = time(); } else { $cache[$username]['lastcheck'] = time()+60; } update_option( 'rarst_twitter_user', $cache ); } if ( false != $display ) echo $cache[$username][$field]; return $cache[$username][$field]; } /******************************* THUMBNAIL SUPPORT ********************************/ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 250, 165, true ); add_image_size( 'homepage-thumb', 198, 132, true ); add_image_size( 'latestpost-thumb', 584, 197, true ); /******************************* EXCERPT LENGTH ADJUST ********************************/ function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).' (...)'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); return $excerpt; } function content($limit) { $content = explode(' ', get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(" ",$content).' (...)'; } else { $content = implode(" ",$content); } $content = preg_replace('/\[.+\]/','', $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); return $content; } /******************************* TOP NAVIGATION MENU WALKER ********************************/ class description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="'. esc_attr( $class_names ) . '"'; $output .= $indent . '
  • id="li-comment-">
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    0 && isset($_POST['alltuts_settings']) ) { $options = array ('logo_img', 'logo_alt','ads','advertise','contact_email','contact_text','cufon','linkedin_link','twitter_user','latest_tweet','number_tweets','facebook_link','keywords','description','analytics','popular_posts', 'copyright'); foreach ( $options as $opt ) { delete_option ( 'alltuts_'.$opt, $_POST[$opt] ); add_option ( 'alltuts_'.$opt, $_POST[$opt] ); } } add_menu_page(__('Alltuts Options'), __('Alltuts Options'), 'edit_themes', basename(__FILE__), 'alltuts_settings'); add_submenu_page(__('Alltuts Options'), __('Alltuts Options'), 'edit_themes', basename(__FILE__), 'alltuts_settings'); } function alltuts_settings() {?>

    AllTuts Options Panel

    General Settings

    current logo:
    <?php echo get_option('alltuts_logo_alt'); ?>

    You need "WP125" plugin installed and activated for this option to make a difference

    You need to create a page for advertising details and selectit here

    Social Links

    Default is 1

    Contact Page Settings

    Footer

    You need "WP-Popular Posts Tool" plugin installed and activated for this option to make a difference

    You can use HTML for links etc.

    SEO

    Keywords comma separated