Forums

Trouble Formatting Top Pages Menu (7 posts)

  1. varresa
    Member
    Posted 5 years ago #

    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!
    http://strawbale.tingull.com

  2. Evita
    Member
    Posted 5 years ago #

    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>

  3. varresa
    Member
    Posted 5 years ago #

    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!

  4. varresa
    Member
    Posted 5 years ago #

    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>

  5. Evita
    Member
    Posted 5 years ago #

    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>

  6. varresa
    Member
    Posted 5 years ago #

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

  7. varresa
    Member
    Posted 5 years ago #

    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!

    http://strawbale.tingull.com

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags