WordPress.org

Ready to get started?Download WordPress

Forums

Where are the navigation links stored in the code? (5 posts)

  1. sulfericacid
    Member
    Posted 3 years ago #

    I need to edit the navigation links section and I don't know which file(s) I have to edit.

    I'm trying to hide one of the links from non logged in users and I found:

    if (is_user_logged_in()) {...}

    Which will do what I want if it is easy enough to implement. Can someone tell me which file to look for and what I'm looking for?

  2. sulfericacid
    Member
    Posted 3 years ago #

    No one knows how to do this?

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

    What navigation links? The menu, or the next/previous post link?

    Also, bumping is against the forum rules, and considered rude. Especially after less than an hour.....

  4. sulfericacid
    Member
    Posted 3 years ago #

    The menu itself. Where all the navigation is done. Ie: http://www.ask-a-geek.com . The "private message" link needs to be hidden from everyone unless they are signed in.

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Alright... here's kind of the pain in the butt. Is that menu just auto generated from your pages?

    Or do you use the custom menu interface?

    There may be a function for omitting pages from the menu if someone is not logged in, I'm not sure.

    On my site when I wanted different links for logged in and not logged in, I registered another nav_menu in functions.php

    Then in header.php I used the is_user_logged_in conditional to display 1 of the 2 menus I had.

    In the menu interface I made a menu appropriate for each

    As I'm sure you know, just hiding the menu item, doesn't keep anyone from accessing the page. If it's important to you to keep it hidden, there are membership plugins to keep people from accessing the page who aren't logged in

Topic Closed

This topic has been closed to new replies.

About this Topic