Support » Fixing WordPress » Can I put Pages and Categories on the same line in main head nav?

  • Resolved h2obarrel

    (@h2obarrel)


    I managed to get my categories into the main head nav along with my pages. The problem is the pages and categories are on separate lines. Is it possible to get them all on one line?
    Thanks!
    h2o

Viewing 13 replies - 1 through 13 (of 13 total)
  • yeah it’s possible, what does your code look like for yur nav?

    <?php wp_list_pages( ‘title_li=&depth=1&exclude=143,9,109,29’ . bp_dtheme_page_on_front() ); ?>

      <?php
      wp_list_categories(‘exclude=&title_li=<h2>’ . __(”) . ‘</h2>’ ); ?>

    <?php do_action( ‘bp_nav_items’ ); ?>
    <!– #nav –>

    I believe because of the way you have wp_list_categories set up….

    the <h2> tags make the categories headings, which I think automatically puts them on their own line….

    The <h2> tags were for the categories title. I didn’t want that to display in my header so I left it blank. (”)

    link to your site to check out the source?

    Set the title to empty and you’ll avoid the title issue.

    wp_list_categories('title_li=' );

    Thanks for the tip t31os_ Title issue is solved.
    Main nav bar looks better, though it’s too wide now. I’d like to not list groups and members links now, so it will fit.
    Here’s the link. http://www.restaurant-diaries.com/
    Thanks
    h2o

    I increased the max width of the nav bar in my CSS file so they all fit on one line now. Can I exclude the “home” link from the list?
    This way the links won’t overlap with the website title.
    Thanks
    h2o

    i don’t know anything about scripting but i want to get my pages and categories in the main nav bar. how do i do this?

    Looks like the first 3 items in your menu are hard-coded in, can’t you just remove them? I’d imagine they preceed the pages and category code you have above.

    Well, here’s the code I think your referring to on header.php.
    Not sure exactly which part to remove.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    It would be this line..

    <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
    " title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?>

    Although i imagine the code looks a little different because some of it has been chopped out by the forum (post code inside backticks when posting to the forum).

    Cool! Thanks. I took out the activity link instead. Thanks for your help on this.
    h2o

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Can I put Pages and Categories on the same line in main head nav?’ is closed to new replies.