'
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); function art_list_pages_filter($output) { $output = preg_replace('~]*)>]*)>([^<]*)~', '$3', $output); $re = '~
  • post_parent) $result[] = $page; return $result; } function art_menu_items($hierarchy) { ob_start(); bloginfo('home'); $home = ob_get_clean(); echo '
  • HOME
  • '; if (!$hierarchy) add_action('get_pages', 'art_header_page_list_filter'); add_action('wp_list_pages', 'art_list_pages_filter'); wp_list_pages('title_li='); remove_action('wp_list_pages', 'art_list_pages_filter'); if (!$hierarchy) remove_action('get_pages', 'art_header_page_list_filter'); } /** header option **/ define('HEADER_IMAGE', '%s/images/' . get_custom_option('header')); // %s is theme directory URI define('HEADER_IMAGE_WIDTH', 600); define('HEADER_IMAGE_HEIGHT', 129); define('NO_HEADER_TEXT', true); add_custom_image_header('', 'custom_admin_header_style'); function custom_admin_header_style() { ?> custom Options, or /wp-admin/themes.php?page=custom-options * in your WordPress directory. * @package custom * @since 2.0 */ class Options { var $installed; var $deleted; var $update_notification; var $sidebar_pp_type; var $header; var $display_title; var $display_tagline; var $nav_pages; var $collapsed_pages; var $home_link_name; var $nav_extlinkcat; var $style; var $asidescategory; var $centred_theme; var $swap_sides; var $tags_everywhere; var $show_categories; var $show_authors; var $use_pages; /** * custom_options_defaults() - Sets Options object's properties to their default values. * * @since 2.0 */ function get_custom_option($name) { global $custom_options; if(!is_object($custom_options)) flush_custom_options(); return $custom_options->$name; } function flush_custom_options() { global $custom_options; $custom_options = new Options; $custom_options->custom_options_get(); if(!get_option('custom_options') || isset($custom_options->deleted)) $custom_options->custom_options_defaults(); } /** * custom_options_get() - Sets Options properties to the values retrieved from the database. * * @since 2.0 */ function custom_options_get() { $saved_options = maybe_unserialize(get_option('custom_options')); if(!empty($saved_options) && is_object($saved_options)) { foreach($saved_options as $name => $value) { $this->$name = $value; } } } function theme_version() { $themedata = get_theme_data(TEMPLATEPATH . '/style.css'); $version = trim($themedata['Version']); if (strlen($version) > 0) return $version; } /** * custom_options_defaults() - Sets Options object's properties to their default values. * * @since 2.0 */ function custom_options_defaults() { $this->update_notification = true; $this->sidebar_pp_type = 'main'; $this->header = 'headerright.jpg'; $this->display_title = true; $this->display_tagline = true; $this->nav_pages = false; $this->collapsed_pages = ''; $this->home_link_name = __('Home','custom'); $this->nav_extlinkcat = 0; $this->style = false; $this->asidescategory = 0; $this->centred_theme = true; $this->swap_sides = false; $this->swap_title_order = false; $this->tags_everywhere = false; $this->show_categories = true; $this->show_authors = true; $this->use_pages = true; } /** * custom_options_update() - Sets Options properties to the values set on the Options page. * * Note that this function doesn't save anything to the database, that's the * preserve of save_custom_options(). * @since 2.0 * @see save_custom_options() */ function custom_options_update() { if(($_POST['delete_options'] == 1)) { $this->deleted = time(); } elseif($_POST['restore_options'] == 1) { unset($this->deleted); } else { if($_POST['update_notification'] == 'off') $this->update_notification = false; elseif($_POST['update_notification'] == 'on') $this->update_notification = true; $header = $_POST['header_image']; if(isset($header)) { $header = str_replace('-thumb', '', $header); $this->header = $header; } $nav_pages = $_POST['nav_pages']; if(isset($nav_pages)) { $nav_pages = implode(',', $nav_pages); $this->nav_pages = $nav_pages; } else { $this->nav_pages = false; } $collapsed_pages = $_POST['collapsed_pages']; if(isset($collapsed_pages)) { $this->collapsed_pages = $collapsed_pages; } else { $this->collapsed_pages = ''; } $stylefile = $_POST['alternate_style']; if(is_valid_custom_style($stylefile)) $this->style = $stylefile; elseif(!$stylefile) $this->style = false; $this->display_title = (bool) $_POST['display_title']; $this->display_tagline = (bool) $_POST['display_tagline']; $this->show_categories = (bool) $_POST['show_categories']; $this->tags_everywhere = (bool) $_POST['tags_everywhere']; $this->use_pages = (bool) $_POST['use_pages']; $this->centred_theme = (bool) $_POST['centred_theme']; $this->swap_sides = (bool) $_POST['swap_sides']; $this->swap_title_order = (bool) $_POST['swap_title_order']; $this->asidescategory = $_POST['asides_category']; $this->nav_extlinkcat = $_POST['nav_extlinkcat']; $this->home_link_name = $_POST['home_link_name']; $this->sidebar_type = $_POST['sidebar_type']; $this->sidebar_pp_type = $_POST['sidebar_pp_type']; $this->show_authors = custom_should_show_authors(); unset($this->deleted); } } } /** * save_custom_options() - Saves a new set of custom options. * * If the custom Options page request includes a $_POST call * and it's been generated by hitting the 'submit' button, this * function will generate a new Options object, set its properties * to the existing set of options, and then save the new options * over the old ones. It then flushes the options so the Options * page, which executes after this function, will display the new * values rather than the old ones. * @see customupdate() which it replaces * @since 2.0 */ function save_custom_options() { $custom_options = new Options; $custom_options->custom_options_get(); if(ready_to_delete_options($custom_options->deleted)) { delete_option('custom_options'); flush_custom_options(); return; } custom_upgrade_and_flush_options(); if(isset($_POST['submit'])) { $custom_options->custom_options_update(); update_option('custom_options', serialize($custom_options)); } flush_custom_options(); } /** * flush_custom_options() - Flushes custom's options for use by the theme. * * Creates a new Options object, and gets the current options. If * no options have been set in the database, it will return the * defaults. Additionally, if the 'deleted' property has been set * then the function will check to see if it was set more than two * hours ago--if it was, the custom_options database row will be * dropped. If the 'deleted' property has been set, then the defaults * will be returned regardless of whether other options are set. * @since 1.4 * @global object $custom_options * @return object $custom_options */ function flush_custom_options() { global $custom_options; $custom_options = new Options; $custom_options->custom_options_get(); if(!get_option('custom_options') || isset($custom_options->deleted)) $custom_options->custom_options_defaults(); } /** * update_custom_option() - Updates the given custom option with a new value. * * This function can be used either to update a particular option * with a new value, or to delete that option altogether by setting * $drop to true. * @since 1.4 * @param string $option * @param string $value * @param boolean $drop * @global object $custom_options */ function update_custom_option($option, $value) { $custom_options = new Options; $custom_options->custom_options_get(); if(empty($value)) unset($custom_options->$option); else $custom_options->$option = $value; update_option('custom_options', serialize($custom_options)); flush_custom_options(); } /** * get_custom_option() - Returns the given custom option. * * @since 1.4 * @param string $name * @return mixed */ function get_custom_option($name) { global $custom_options; if(!is_object($custom_options)) flush_custom_options(); return $custom_options->$name; } function custom_headerimage() { if(get_theme_mod('header_image')) { $header_img_url = get_header_image(); } elseif(get_custom_option('header')) { if(get_custom_option('header') != 'blank.gif') { $header_img_url = get_bloginfo('template_directory') . '/images/' . get_custom_option('header'); } } else { $header_img_url = get_bloginfo('template_directory') . '/images/headerright.jpg'; } if($header_img_url) { if(get_custom_option('display_title')) { $header_img_alt = __('Header image','custom'); } else { $header_img_alt = get_bloginfo('name'); } $header_img_tag = "
    "; if(!get_custom_option('display_title') && !is_wp_front_page()) { $header_img_tag = sprintf( '%3$s', __('Return to main page','custom'), user_trailingslashit(get_bloginfo('url')), $header_img_tag ); } echo '
    ' . $header_img_tag.'
    ';}} function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    ' ); ?> %s says:'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>