$bwt = ''; $ewt = ''; $bwc = ''; $ewc = ''; $ew = ''; $result = ''; $startBlock = 0; $endBlock = 0; while (true) { $startBlock = strpos($content, $bw, $endBlock); if (false === $startBlock) { $result .= substr($content, $endBlock); break; } $result .= substr($content, $endBlock, $startBlock - $endBlock); $endBlock = strpos($content, $ew, $startBlock); if (false === $endBlock) { $result .= substr($content, $endBlock); break; } $endBlock += strlen($ew); $widgetContent = substr($content, $startBlock, $endBlock - $startBlock); $beginTitlePos = strpos($widgetContent, $bwt); $endTitlePos = strpos($widgetContent, $ewt); if ((false == $beginTitlePos) xor (false == $endTitlePos)) { $widgetContent = str_replace($bwt, '', $widgetContent); $widgetContent = str_replace($ewt, '', $widgetContent); } else { $beginTitleText = $beginTitlePos + strlen($bwt); $titleContent = substr($widgetContent, $beginTitleText, $endTitlePos - $beginTitleText); if (' ' == $titleContent) { $widgetContent = substr($widgetContent, 0, $beginTitlePos) . substr($widgetContent, $endTitlePos + strlen($ewt)); } } if (false === strpos($widgetContent, $bwt)) { $widgetContent = str_replace($bw, $bw . $bwc, $widgetContent); } else { $widgetContent = str_replace($ewt, $ewt . $bwc, $widgetContent); } $result .= str_replace($ew, $ewc . $ew, $widgetContent); } return $result; } function art_sidebar($index = 1) { if (!function_exists('dynamic_sidebar')) return false; ob_start(); $success = dynamic_sidebar($index); $content = ob_get_clean(); if (!$success) return false; $content = art_normalize_widget_style_tokens($content); $replaces = array( '' => "
\r\n
\r\n", '' => "
\r\n
\r\n
\r\n
\r\n
", '' => "
\r\n
\r\n
", '' => "
\r\n
\r\n", '' => "\r\n
\r\n
\r\n
\r\n", '' => "\r\n
\r\n
\r\n
\r\n" ); $bwt = ''; $ewt = ''; if ('' == $replaces[$bwt] && '' == $replaces[$ewt]) { $startTitle = 0; $endTitle = 0; $result = ''; while (true) { $startTitle = strpos($content, $bwt, $endTitle); if (false == $startTitle) { $result .= substr($content, $endTitle); break; } $result .= substr($content, $endTitle, $startTitle - $endTitle); $endTitle = strpos($content, $ewt, $startTitle); if (false == $endTitle) { $result .= substr($content, $startTitle); break; } $endTitle += strlen($ewt); } $content = $result; } $content = str_replace(array_keys($replaces), array_values($replaces), $content); echo $content; return true; } function art_activeID($pages){ $result = null; foreach ($pages as $index => $page){ if (is_page($page->ID)) { $result = $page; break; } } while($result && $result->post_parent) { foreach ($pages as $index => $parent){ $p = get_page($result->post_parent); if ($p->post_status == 'private') { $pages[$index]->post_parent = 0; $result->post_parent = 0; $childs = array(); $childs = get_page_children( $p->ID, $pages ); foreach ($childs as $key => $child){ $childs[$key]->post_parent = 0; } $childs = array(); $childs = get_page_children( $result->ID, $pages ); foreach ($childs as $key => $child){ $childs[$key]->post_parent = 0; } } if ($parent->ID == $result->post_parent) { $p = get_page($parent->post_parent); if ($p->post_status != 'private') { $result = $parent; break; } else { $pages[$index]->post_parent = 0; $childs = array(); $childs = get_page_children( $parent->ID, $pages ); foreach ($childs as $key => $child){ $childs[$key]->post_parent = 0; } } } } } return ($result ? $result->ID : null); } function art_blogID($pages){ $result = null; if(!'page' == get_option('show_on_front')) return $result; $blogID = get_option('page_for_posts'); if (!$blogID) return $result; foreach ($pages as $index => $page){ if ($page->ID == $blogID) { $result = $page; break; } } while($result && $result->post_parent) { foreach ($pages as $parent){ if ($parent->ID == $result->post_parent) { $result = $parent; breack; } } } return ($result ? $result->ID : null); } function art_process_front(&$pages){ if ('page' != get_option('show_on_front')) return; $frontID = get_option('page_on_front'); if (!$frontID) return; foreach ($pages as $index => $page) if($page->ID == $frontID) { unset($pages[$index]); $page->post_parent = '0'; $page->menu_order = '0'; array_unshift($pages, $page); break; } } function art_topIDs($pages){ $result = array(); foreach ($pages as $index => $page){ if (!$page->post_parent) $result[]=$page->ID; else { $p = get_page($page->post_parent); if ($p->post_status == 'private') { $result[]=$page->ID; $childs = array(); $childs = get_page_children( $page->ID, $pages ); foreach ($childs as $child){ $result[]=$child->ID; } } } } return $result; } function art_remove_subitems(&$pages){ foreach ($pages as $index => $page) if ($page->post_parent) unset($pages[$index]); } function art_header_page_list_filter($pages) { global $artThemeSettings; art_process_front($pages); $artThemeSettings['menu.topItemIDs'] = art_topIDs($pages); $artThemeSettings['menu.activeID'] = art_activeID($pages); $artThemeSettings['menu.blogID'] = art_blogID($pages); if (!$artThemeSettings['menu.showSubmenus']) art_remove_subitems($pages); return $pages; } function art_list_pages_filter($output) { global $artThemeSettings; $pref ='page-item-'; if($artThemeSettings['menu.topItemIDs']) foreach($artThemeSettings['menu.topItemIDs'] as $id){ $output = preg_replace('~
  • ]+)>([^<]*)~', '
  • ' . $artThemeSettings['menu.topItemBegin'] . '$5' . $artThemeSettings['menu.topItemEnd'] . '', $output, 1); } $frontID = null; $blogID = null; if('page' == get_option('show_on_front')) { $frontID = get_option('page_on_front'); $blogID = $artThemeSettings['menu.blogID']; } if ($frontID) $output = preg_replace('~
  • '.$artThemeSettings['menu.topItemBegin'] . $artThemeSettings['menu.homeCaption'] . $artThemeSettings['menu.topItemEnd'] . '
  • '; add_action('get_pages', 'art_header_page_list_filter'); add_action('wp_list_pages', 'art_list_pages_filter'); wp_list_pages('title_li=&sort_column=menu_order'); remove_action('wp_list_pages', 'art_list_pages_filter'); remove_action('get_pages', 'art_header_page_list_filter'); } add_filter('comments_template', 'legacy_comments'); function legacy_comments($file) { if(!function_exists('wp_list_comments')) : // WP 2.7-only check $file = TEMPLATEPATH.'/legacy.comments.php'; endif; return $file; } Agriturismo Il Giardino: Terme di Saturnia

    Fatal error: Call to undefined function art_sidebar() in /home/benes1/public_html/agriturismoilgiardino/wp-content/themes/agriturismoilgiardino/sidebar1.php on line 2