'Main Sidebar', 'id' => 'main-sidebar')); register_sidebar(array('name' => 'Right Sidebar', 'id' => 'right-sidebar')); // WP-Andreas09 Search Box function widget_andreas09_search() { ?>
  • "; break; case "option": if( $selected == $value ) { $extra = "selected=\"true\""; } echo ""; break; } } /* Plugin Name: PageNav Plugin URI: http://www.adsworth.info/wp-pagesnav Description: Header Navigation. Author: Adi Sieker Version: 0.0.1 Author URI: http://www.adsworth.info/ */ /* Copyright 2004 Adi J. Sieker (email : adi@adsworth.info) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function wp_andreas09_nav($args = '') { global $wp_query; parse_str($args, $r); if (!isset($r['current'])) $r['current'] = -1; if (!isset($r['show_all_parents'])) $r['show_all_parents'] = 0; if (!isset($r['show_root'])) $r['show_root'] = 0; if (!isset($r['list_tag'])) $r['show_root'] = 1; if($r['current'] == "") return; if($r['current'] == -1 && $wp_query->is_page == true) { $r['current'] = $wp_query->post->ID; } if($r['current'] == -1 && $r['show_root'] != 0) { $r['current'] = 0; } $parent_out = false; // Query pages. $pages = get_pages($args); if ( $pages ) { // Now loop over all pages that were selected $page_tree = Array(); $parent_page_id = null; $parents= Array(); foreach($pages as $page) { // set the title for the current page $page_tree[$page->ID]['title'] = $page->post_title; $page_tree[$page->ID]['parent'] = $page->post_parent; // set the selected date for the current page // depending on the query arguments this is either // the createtion date or the modification date // as a unix timestamp. It will also always be in the // ts field. if (! empty($r['show_date'])) { if ('modified' == $r['show_date']) $page_tree[$page->ID]['ts'] = $page->time_modified; else $page_tree[$page->ID]['ts'] = $page->time_created; } // The tricky bit!! // Using the parent ID of the current page as the // array index we set the curent page as a child of that page. // We can now start looping over the $page_tree array // with any ID which will output the page links from that ID downwards. $page_tree[$page->post_parent]['children'][] = $page->ID; if( $r['current'] == $page->ID) { if($page->post_parent != 0 || $r['show_root'] == true) $parents[] = $page->post_parent; } } $len = count($parents); for($i = 0; $i < $len ; $i++) { $parent_page_id = $parents[$i]; $parent_page = $page_tree[$parent_page_id]; if(isset($parent_page['parent']) && !in_array($parent_page['parent'], $parents)) { if($parent_page['parent'] != 0 || $r['show_root'] == true) { $parents[] = $parent_page['parent']; $len += 1; if( $len >= 2 && $r['show_all_parents'] == 0) { break; } } } } $parents = array_reverse($parents); $level = 0; $parent_out = false; foreach( $parents as $parent_page_id ) { $level += 1; $css_class = 'level' . $level; if( $r['list_tag'] == true || $parent_out == true) echo ""; $parent_out = true; } if( is_array($page_tree[$r['current']]['children']) === true ) { $level += 1; $css_class = 'level' . $level; if( $r['list_tag'] == true || $parent_out == true) echo ""; } } } // Header navigation menu register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'andreas09' ) ) ); // Fallback for primary navigation function andreas09_page_menu() { ?>
  • id="comment-">

    comment_approved == '0') : ?>
    'comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '09b910', 'url' => '808080', ); break; case 'red': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => 'c0090e', 'url' => '808080', ); break; case 'orange': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => 'c9740a', 'url' => '808080', ); break; case 'purple': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '890abb', 'url' => '808080', ); break; case 'black': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '5c5c5c', 'url' => '808080', ); break; case 'isecore': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '536d88', 'url' => '808080', ); break; case 'pink': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => 'd964bf', 'url' => '808080', ); break; case 'blue2': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '0b6d90', 'url' => '808080', ); break; case 'green2': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '1d8807', 'url' => '808080', ); break; case 'red2': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '940c0e', 'url' => '808080', ); break; case 'orange2': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => 'ce750d', 'url' => '808080', ); break; case 'purple2': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '6c0c91', 'url' => '808080', ); break; case 'black2': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '4e4e4e', 'url' => '808080', ); break; case 'blue': $themecolors = array( 'bg' => 'fafcff', 'border' => 'f0f1f3', 'text' => '2a2a2a', 'link' => '0a8fbc', 'url' => '808080', ); break; } /** * WP.com: Show a nice admin message noting that the current theme has been * trumped by a newer one. */ function andreas09_add_notice() { $current_theme = wp_get_theme()->Name; if ( ! get_user_meta( get_current_user_id(), "$current_theme-theme-update", true ) ) { add_settings_error( 'theme-update', 'theme-update', sprintf( __( 'Howdy! Your current theme, %1$s, has seen an update in the form of a brand new theme, %2$s. For more information, check out our blog post introducing %2$s to the world. %5$s' ), $current_theme, // Old theme 'Able', // New theme admin_url( 'themes.php?s=able' ), // Link to new theme esc_url( 'http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sight/' ), // Link to announcement post sprintf( '×', __( 'Dismiss' ) ) // Dismiss ), 'updated' ); remove_action( 'admin_notices', 'show_tip' ); if ( ! has_filter( 'admin_notices', 'settings_errors' ) ) add_action( 'admin_notices', 'settings_errors' ); wp_enqueue_script( 'dismiss-theme-update', get_template_directory_uri() . '/js/dismiss-theme-update.js', array( 'jquery' ), 20130225 ); wp_localize_script( 'dismiss-theme-update', 'dismissThemeUpdate', array( 'theme' => $current_theme, 'nonce' => wp_create_nonce( "$current_theme-theme-update" ), ) ); } } add_action( 'admin_init', 'andreas09_add_notice' ); /** * Updates user setting when theme update notice was dismissed. */ function andreas09_dismiss_theme_update() { $current_theme = wp_get_theme()->Name; check_ajax_referer( "$current_theme-theme-update", 'nonce' ); if ( $_REQUEST['theme'] == $current_theme ) { update_user_meta( get_current_user_id(), "$current_theme-theme-update", true ); wp_die( 1 ); } } add_action( 'wp_ajax_dismiss_theme_update', 'andreas09_dismiss_theme_update' ); /** * Load theme options file. */ require( dirname( __FILE__ ) . '/inc/theme-options.php' );