• Resolved hrcwebmaster

    (@hrcwebmaster)


    I am using a plug in to switch menus depending on the page you’ve selected. However, my theme only allows for three custom menus, and I will end up creating close to 50 menus (sounds crazy, but it’s a different menu for each person).
    I am wondering if there is a way to put code within the custom link URL to pull a custom field. For example, I want to create a Home/Newsroom/Biography page for each of our members. So what I’m hoping is to use some code so that the custom menu is called “Members” and within that is Home with the URL something like https://mysite.org/$membernews where $membernews would be the name of the custom field. So that each time you clicked on “Joe Smith” from the home page it would switch menus and then when you click on “News” it will open up the page based on the custom field within the parent page “Joe Smith.” Is this even possible?
    I have looked everywhere it seems, and have tried to put PHP script into the custom link URLs, but it’s not accepted.
    Any ideas are helpful, thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter hrcwebmaster

    (@hrcwebmaster)

    OK I figured out part of this. I put this code in my functions template:

    #set ($name = get_post_meta($post->ID, 'member-name', true)

    Then in my menu I can put https://www.mysite.org/$name/bio.

    For each of my parent and children pages, I put the custom field name as “member-name” and the values as the “joe-smith.”

    So when I go to Joe Smith’s page, it will go to his Bio, Newsroom, etc. But when I switch to Sally Anderson’s page, and click on Bio or Newsroom, it takes me to Joe Smith’s Bio, Newsroom, etc.

    So close, would appreciate any help!!

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Anybody?

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Never mind, I realized I can create as many custom menus as I want (hopefully as many as I want!), my theme limits me to 3 menus for footer/side/header.
    I used this thread. to find code to put in my header file to pull the appropriate menu I want.
    Anyway, great discussion ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom fields and custom menus’ is closed to new replies.