Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( function_exists('register_sidebar') )
- {
- register_sidebar(array(
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widgettitle">',
- 'after_title' => '</h2>',
- ));
- }
- function wp_list_pages2($limit=NULL) {
- $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'),
- 'child_of' => 0, 'exclude' => '', 'title_li' =>'', 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title');
- $r = array_merge((array)$defaults, (array)$r);
- $output = '';
- $current_page = 0;
- // sanitize, mostly to keep spaces out
- $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
- // Allow plugins to filter an array of excluded pages
- $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));
- // Query pages.
- $pages = get_pages($r);
- if ( !empty($pages) ) {
- for($i=0;$i<count($pages);$i++)
- {
- $output .='<li><a href="'.get_page_link($pages[$i]->ID).'">'.$pages[$i]->post_title.'</a></li>';
- if($limit!=NULL)
- {
- break;
- }
- }
- }
- $output = apply_filters('wp_list_pages', $output);
- echo $output;
- }
- /* JS for bokmark */
- wp_enqueue_script( 'config', '/wp-includes/js/config.js', false, NULL );
- add_action( 'wp_head', 'wp_enqueue_script');
- /* Remove unusful header metatags */
- remove_action( 'wp_head', 'feed_links_extra', 3 );
- remove_action( 'wp_head', 'feed_links', 2 );
- remove_action( 'wp_head', 'rsd_link' );
- remove_action( 'wp_head', 'wlwmanifest_link' );
- remove_action( 'wp_head', 'index_rel_link' );
- remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
- remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
- remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
- remove_action( 'wp_head', 'wp_generator' );
- ?>
Add Comment
Please, Sign In to add comment