WordPress.org

Ready to get started?Download WordPress

Forums

Global Navigation Across Site (3 posts)

  1. neelhtakbackwards
    Member
    Posted 3 years ago #

    I am trying to set up a global navigation across my entire site (to be found in the header area). I do not wish to hardcode the links, but rather have them dynamically generated. Note that I use categories as navigational elements.

    I currently have two "sub-blogs" installed upon my website. It is as follows:

    - http://www.katskinner.com (the home page)
    - http://www.katskinner.com/about (standard about page found in the main site)
    - http://www.katskinner.com/contact (standard contact page found in main site)
    - http://www.katskinner.com/writing/ (a sub-blog).
    - http://www.katskinner.com/writing/category1/
    - http://www.katskinner.com/writing/category1/posttitle
    - http://www.katskinner.com/writing/category2/
    - http://www.katskinner.com/writing/category2/posttitle
    - http://www.katskinner.com/coding/ (a sub-blog).
    - http://www.katskinner.com/coding/category1/
    - http://www.katskinner.com/coding/category1/posttitle
    - http://www.katskinner.com/coding/category2/
    - http://www.katskinner.com/coding/category2/posttitle

    I wish to display drop down menu's for my header. So without scroll over the user will see:
    - Home (katskinner.com)
    - About
    - Writing
    - Coding
    - Contact

    If the user was to scroll over "writing", they will see something like the following (and so forth for any sub-categories):
    - Home
    - About
    - Writing
    - category 1
    - sub category 1
    - sub category 2
    - category 2
    - category 3
    - coding
    - contact

    How can I code this in wordpress?

  2. just before the nav bar code put
    <?php switch_to_blog(1); ?>
    right after the navbar code put
    <?php restore_current_blog(); ?>
    then it will always show the pages from Blog #1.

    For example, anyway. :)

    To pull from multiple blogs, you;d have to do that a couple times for each one.

    But on a large site, the switch_to_blog function gets expensive.

  3. neelhtakbackwards
    Member
    Posted 3 years ago #

    Thanks. It worked perfectly for my current needs. I don't suppose their is a script (perhaps php) that checks for the number of blogs, and automatically switches and pulls categories/pages as needed?

Topic Closed

This topic has been closed to new replies.

About this Topic