Hi,
I am in a position where I need to modify a site that I did not build, and the person that built it cannot be contacted. Here is the site.
Basically, I need create sub-menu items of a button in the navigation that currently does not have any. I need to add a dropdown to “Contact.” I can’t figure out what is different between the buttons with dropdowns and the buttons without, with respect to the PHP. The problem is that the person the created the website opted not to use the built-in menu creation and coded everything with PHP. I don’t understand PHP enough to figure out what is keeping the child items from displaying underneath this button upon hovering over it.
Here is the code for the navigation menu:
[php]
- Home
-
About Us
<?php $childpages = get_pages("child_of=8"); if ($childpages) { ?>
- Who Are We? <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=8&depth=2'); ?>
-
Blog
- <?php wp_list_categories('title_li=&depth=2'); ?> <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=6&depth=2'); ?>
-
Schools <?php $childpages = get_pages("child_of=13"); if ($childpages) { ?>
- <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=13&depth=2'); ?>
-
Get Involved <?php $childpages = get_pages("child_of=16"); if ($childpages) { ?>
- <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=16&depth=2'); ?>
-
Membership <?php $childpages = get_pages("child_of=17"); if ($childpages) { ?>
- <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=17&depth=2'); ?>
-
Store <?php $childpages = get_pages("child_of=18"); if ($childpages) { ?>
- <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=18&depth=2'); ?>
-
Donate <?php $childpages = get_pages("child_of=19"); if ($childpages) { ?>
- <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=19&depth=2'); ?>
-
Contact <?php $childpages = get_pages("child_of=15"); if ($childpages) { ?>
- <?php wp_list_pages('title_li=&sort_column=menu_order&child_of=20&depth=2'); ?>
About Us, Blog, and Schools have sub-menu items, but the rest of the buttons do not. However, from looking at the PHP, I can’t tell what makes those buttons different internally from the ones that cannot display sub-menu items.
I have tried adding items as child pages to these main pages using the dialogue box on the Page Edit screen, but this doesn’t cause any change either. I think maybe this is the reason that some look hard-coded and other don’t?
I assume that I need to somehow modify that “if” statement, but after reading tons of documentation, I am at a complete loss. Does anyone have any advice for me?
Thank you!