The following code is very useful when debugging or fiddling around with hook priorities. Knowing what’s hooked into wp_head() in what order is important, and this function is a great asset!

function list_hooked_functions($tag=false){
	global $wp_filter;
	if ($tag) {
		$hook[$tag]=$wp_filter[$tag];
		if (!is_array($hook[$tag])) {
			trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
			return;
		}
	}
	else {
		$hook=$wp_filter;
		ksort($hook);
	}

	echo '<pre>';

	foreach($hook as $tag => $priority){
		echo "<br />&gt;&gt;&gt;&gt;&gt;t<strong>$tag</strong><br />";
		ksort($priority);
		foreach($priority as $priority => $function){
			echo $priority;
			foreach($function as $name => $properties) {
				echo "t$name<br />";
			}
		}
	}
	echo '</pre>';
	return;
}

 

To disable admin bar for all groups of users except admin, just paste the following code in your theme’s functions.php file.

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

easy-peasy ;)

To display child pages on a parent page in WordPress just edit theme’s functions.php file and and the following code:

 global $post;
if ( is_page() &amp;&amp; $post-&gt;post_parent )
$childpages = wp_list_pages( 'sort_column=menu_order&amp;title_li=&amp;child_of=' . $post-&gt;post_parent . '&amp;echo=0' );
else
$childpages = wp_list_pages( 'sort_column=menu_order&amp;title_li=&amp;child_of=' . $post-&gt;ID . '&amp;echo=0' );
if ( $childpages ) {
$string = '</code>
<ul>' . $childpages . '</ul>
';
}
return $string;
}
add_shortcode('wpb_childpages', 'wpb_list_child_pages');

Then add the [wpb_childpages] shortcode wherever you need to display child pages. ;)

If you need to Display Child Pages Without Any Shortcode dinamically, you need to add this line of code where you want to display child pages:

The theme will now automatically detect child pages and display them.