WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can I put Pages and Categories on the same line in main head nav? (14 posts)

  1. h2obarrel
    Member
    Posted 4 years ago #

    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

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    yeah it's possible, what does your code look like for yur nav?

  3. h2obarrel
    Member
    Posted 4 years ago #

    <?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 -->

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    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....

  5. h2obarrel
    Member
    Posted 4 years ago #

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

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    link to your site to check out the source?

  7. Mark / t31os
    Moderator
    Posted 4 years ago #

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

    wp_list_categories('title_li=' );
  8. h2obarrel
    Member
    Posted 4 years ago #

    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

  9. h2obarrel
    Member
    Posted 4 years ago #

    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

  10. pddle
    Member
    Posted 4 years ago #

    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?

  11. Mark / t31os
    Moderator
    Posted 4 years ago #

    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.

  12. h2obarrel
    Member
    Posted 4 years ago #

    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]

  13. Mark / t31os
    Moderator
    Posted 4 years ago #

    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).

  14. h2obarrel
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic