Forums

[resolved] Sandbox: Navigation - Global Access (6 posts)

  1. khlota
    Member
    Posted 2 months ago #

    I am new to blog development so don't shoot me for asking what may seem like a silly question ;) I only know CSS and HTML.... but I am hoping I can make enough connections with code, common sense and forums to do what I want.

    I am modifying a theme and want to change the navigation titles as well as add to them. This theme 'modmat' is based off of Sandbox.
    For the life of me I don't see where I can do this. I have adjusted what I could with the /* MENU */ and I see that <?php sandbox_globalnav() ?> is referenced in the PHP but for the life of me I cannot find code with the word 'About' that may clue me in to what I need to do.

    I was thinking somewhere in functions/sandbox.php or modmat.php or just functions.php.......... ANY HELP would be GREATLY APPRECIATED.

  2. esmi
    Member
    Posted 2 months ago #

    Check in functions.php for the sandbox_globalnav() function. Chances it's using either wp_list_pages or get_pages to produce a page list - assuming that "About" is a page title.

  3. khlota
    Member
    Posted 2 months ago #

    It does, thanks. This is where I saw the 'home' but could not find the 'about'. I guess I need to figure out how to edit it but it's PHP so I am weary. I'll check out the above link. If you have any other advice here's part of the code.

    function sandbox_globalnav() {
    echo '<div id="menu">

      ';
      echo '<li';
      if ( is_home() ) {
      echo ' class="current_page_item"';
      }
      echo '>Home';
      $menu = wp_list_pages('title_li=&sort_column=menu_order&depth=1&echo=0'); // Params for the page list in header.php
      echo str_replace(array("\r", "\n", "\t"), '', $menu);
      echo "
    </div>\n";
    }

  4. khlota
    Member
    Posted 2 months ago #

    See I swear I follow the clues but am still clueless! I don't understand how it generates a list without that list actually existing in typed english format somewhere. I have scanned this file as well as the 'post-template' in wp-includes, back to the header.php, etc. If I could only find the second clue of 'About' (this theme has 'home' and 'about' as navigation) I could at least see MAYBE where to add onto it.... I got nothing so far.

  5. esmi
    Member
    Posted 2 months ago #

    $menu = wp_list_pages('title_li=&sort_column=menu_order&depth=1&echo=0')

    is the line that produces the Page link list. If you follow the link to wp_list_pages above, you'll see that you can use an exclude parameter to force the exclusion of a specific Page (by its id number) if that's what you're looking for.

  6. khlota
    Member
    Posted 2 months ago #

    wow, that's practically latin for me ;)

    Thank you so much for your help. I will do my best to figure this out.

Reply

You must log in to post.

About this Topic