Forum Replies Created

Viewing 1 replies (of 1 total)
  • pdm

    (@pdm)

    I wanted to do a similar thing, and not include all the child pages in the main navigation. I made a new function in the BX_functions.php page, and then in the header file, replaced $pages = BX_get_pages(); with this new function $pages = BX_get_main_pages();

    The new function is below, which is the same as $pages = BX_get_pages(); except in the query I added and post_parent='0' which only gets the parent pages. Hope that helps someone.


    function BX_get_main_pages($with_content = '')
    {
    global $wpdb;
    $query = "SELECT ID, post_title, post_name FROM " . $wpdb->posts . " WHERE post_status='static' and post_parent='0' ORDER BY menu_order ASC";
    if ($with_content == "with_content") {
    $query = "SELECT ID, post_title,post_name, post_content FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";
    }
    return $wpdb->get_results($query);
    }

Viewing 1 replies (of 1 total)