• I am trying to reorder the pages on my top menu. I have set the order in the pages admin (1,2,3,etc) and here is my code:
    <ul>
    <li <?php if(is_home()){echo 'class="first current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>/" title="Home">Home</a></li>
    <?php wp_list_pages('sort_column=menu_order')?>
    </ul>

    Unfortunately, this caused the whole menu to drop down on the page to UNDER where it should be and is invisible unless you mouse over it. In the place where the menu is supposed to be is just the word “PAGES”. Can anyone explain how I fix this?

    Thanks!
    https://strawbale.tingull.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try this:
    <ul>
    <?php if ( is_home() ) { ?>
    <li class="first current page item"><a href="<?php echo get_settings('home'); ?>" title="<?php bloginfo('name'); ?> - Home">Home</a></li>
    <?php } else { ?>
    <li class="page_item"><a href="<?php echo get_settings('home'); ?>/" title="<?php bloginfo('name'); ?> - Home">Home</a></li><?php wp_list_pages('sort_column=menu_order&title_li=')?>
    </ul>

    Thread Starter varresa

    (@varresa)

    Thank you for the reply – I replaced with your code from above and got this error in place of my page:

    Parse error: syntax error, unexpected $end in /home/tingull/public_html/strawbale/wp-content/themes/terrafirma/header.php on line 53

    Any ideas?

    Thank you!

    Thread Starter varresa

    (@varresa)

    If it helps, here is the original code, which I reverted back to for the time being:
    <ul>
    <li <?php if(is_home()){echo 'class="first current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>/" title="Home">Home</a></li>
    <?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'.$pages_to_exclude)?>
    </ul>

    Sorry, my mistake – this is the right code:
    <ul>
    <?php if ( is_home() ) { ?>
    <li class="first current page item"><a href="<?php echo get_settings('home'); ?>" title="<?php bloginfo('name'); ?> - Home">Home</a></li>
    <?php } else { ?>
    <li class="page_item"><a href="<?php echo get_settings('home'); ?>/" title="<?php bloginfo('name'); ?> - Home">Home</a></li>
    <?php } ?>
    <?php wp_list_pages('sort_column=menu_order&title_li=')?>
    </ul>

    Thread Starter varresa

    (@varresa)

    Perfect! Thank you so much for checking back in again – I appreciate it!

    Thread Starter varresa

    (@varresa)

    I am having a similar problem again with the top menu. When I add a sub-page to an existing page, the rest of the links on the menu disappear and the search bar again moves off the menu. I have removed the sub-page for now, but could put it back if someone would like to see it broken.

    Thanks!

    https://strawbale.tingull.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Trouble Formatting Top Pages Menu’ is closed to new replies.