Forums

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

Home Forums Back End Simple php problem

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #31338
    EricM
    Member

    I’m embarrassed that I can’t figure this out on my own, but I don’t have a php background. I have a code block in wordpress to put in the submenu in the header depending on the parent page, but I don’t want it on the home-page. How would I code it to not show a sub-menu on the home page? Or any other particular page, for that matter?


    #64956
    dhechler
    Member

    Try this. You can just say if is_page then the page number. So basically you are only showing the submenu on certain pages. The last else statement just puts your main menu on all other pages.



    #64664
    EricM
    Member

    Thanks, but what I’m trying to write is a statement that doesn’t default to a sub-menu, I want the default to return nothing.

    #64656
    dhechler
    Member

    then that would be



    #64534
    EricM
    Member

    That didn’t work, but I figured it out. The last line before closing tag:

    //no sub menu displayed
    wp_list_pages('echo=0');
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.