Hello..
Apolgy for any n00bness here, but I am in somewhat dire need of help. I used the menu trick with the subtitles from http://themeshaper.com/wordpress-menu-tricks/ and have yet to figure out how to make sure it only displays 3 specific pages. I know the include parameter, but I can't for the life of me figure out where to put the parameter there..
My code is pretty much the same as the one in the tuturial. I'm using a childtheme.
// First we need to remove the action creating the menu
function remove_access($content) {
remove_action('thematic_header','thematic_access',9);
}
add_action('init', 'remove_access');
// Now we need to rebuild it
function childtheme_access() { ?>
<div id="access">
<?php wp_page_menu(); ?>
</div><!– #access –>
<?php }
add_action('thematic_header','childtheme_access',9);
function sub_page_list() {
global $wpdb;
$sql = "SELECT p.ID, p.post_title, p.guid, pm.meta_value FROM " . $wpdb->posts . " AS p LEFT JOIN ";
$sql .= "(SELECT post_id, meta_value FROM " . $wpdb->postmeta . " AS ipm WHERE meta_key = 'subtitle') ";
$sql .= "AS pm ON p.ID = pm.post_id ";
$sql .= "WHERE p.post_type = 'page' AND p.post_parent = 0 AND p.post_status = 'publish' ";
$sql .= "ORDER BY p.menu_order ASC ";
$sql .= "LIMIT 0, 10";
$rows = $wpdb->get_results($sql,OBJECT);
if($rows) {
foreach($rows as $row) {
echo "
<li>";
$link_url = get_permalink($row->ID);
echo "<a>$row->post_title</a>";
echo "<span class=\"sub\">$row->meta_value</span>";
echo "</li>
";
}
}
}
// Filter the menu to add the list
function childtheme_page_menu() { ?>
<div class="menu">
<ul class="sf-menu">
<?php sub_page_list(); ?>
</div>
<?php }
add_filter('wp_page_menu','childtheme_page_menu');