The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] WordPress header and new pages

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #28600

    How do you get new pages that are created to appear in the header? I could always do it manually in the html, but that’s not the point of wordpress.

    Also, how do you have a navigation list-item have a class when it’s on its corresponding page? For example, when you’re on the home page, the home list-item will have a current-page class or when you’re on the about page, the about list-item will have a current-page class.

    Thanks for the help in advance.


    Found the appropriate code. I’m using starkers theme and since it’s torn down to the basics, it didnt have it. Here is the code.

    get_results(‘select ID, post_title from ‘. $wpdb->posts .’ where post_status = “publish” and post_type = “page” order by ID’);


    return $these_pages;


    function list_all_pages(){

    $all_pages = get_the_pa_ges ();

    foreach ($all_pages as $thats_all){

    $the_page_id = $thats_all->ID;

    if (is_page($the_page_id)) {

    $addclass = ‘ class=”current_page”‘;

    } else {

    $addclass = ”;


    $output .= ‘ID).'” title=”‘.$thats_all->post_title.'”>‘.$thats_all->post_title.’‘;


    return $output;




      echo list_all_pages();?>

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.