• I am trying to buid different navigation on different pages. I have used the below code and it works fine. However, I am unclear how to incorporate subpages.

    For instance, i would like to write in php….

    if the page being viewed is a subpage of birthday, then include links.php, but if it is a subpage of gifts then include links-home.php.

    Can someone tell me how to include the above into php code?

    Thank you….

    if (is_page()) {
    
            // we're looking at a static page.  Which one?
    
            if (is_page('birthday')) {
    
                 // our about page.
                 include 'links.php'; }
    
            elseif (is_page('gifts')) {
                 include 'links-home.php'; }
    
    else {
            // catch-all for everything else (archives, searches, 404s, etc)
    
            include 'links-all.php';
    
    } // That's all, folks!
  • The topic ‘php help with custom page navigation and subpages’ is closed to new replies.