• devsau

    (@devsau)


    Hii,
    I am using virtue theme, and i love it.
    But , right now i am stuck and needed help.
    The problem is , i have a primary navigation menu which has several links. what i wanted is when clicked on certain link ‘X’ it should show page ‘A'(ONLY IF LOGGED-IN) OR else page ‘B'(IF NOT LOGGED-IN) .
    i have tried several things in”functions.php” , but it doesn’t work… and i land up with server 500 error
    so, please help me with the same.

    Thank you,

Viewing 5 replies - 1 through 5 (of 5 total)
  • hannah

    (@hannahritner)

    Hey,
    This site explains using different menus for logged in users- https://www.wpbeginner.com/wp-themes/how-to-show-different-menus-to-logged-in-users-in-wordpress/
    Hope it helps! Let me know if you have further questions getting this working.

    Hannah

    Thread Starter devsau

    (@devsau)

    I don’t have any problems in menu, if you read my query properly you will understand.

    hannah

    (@hannahritner)

    Sorry, I should have explained better. There isn’t a simple way to have a single menu item link to one page for one user and another for different user. I think using separate menus for separate users is the best, and easiest, solution. Did you look into getting this set up or does this approach not work for you?

    Hannah

    Thread Starter devsau

    (@devsau)

    Dear Hannah,
    I think you still haven’t understood the problem.
    anyways , i will try again to explain.
    i have made two menus one is logged-in and other is non-logged in.
    both of which have a common link suppose named “X”. Now, what i am intending to do is , when clicked on link “X”(it is part of primary menu as option) it should open a page “A”(FOR LOGGED-IN USERS) OR Else it should open a page “B”(which i have made for non-logged-in use.rs)
    Basically,what i am trying to do is to open a page when clicked on a link in menu and checking whether the user is logged in or not and displaying the page accordingly.
    Hope dear you will understand.
    Thank you,

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    Hey devsau,

    I do think I understand what your asking for. Unfortunately I don’t know of any thing that would work the way you are describing. (checking when the link is clicked).
    But hannah’s suggestion would be a great way to do this since you can change the label for any item in your menu. You can make two seperate links have the same menu label. Since your already showing a different menu if the user is logged in or not it does make a lot of sense just to have the url already set in the menu item rather then trying to add a system that checks once the menu item is clicked.

    So for your logged in users menu you would add the menu item for page A and set the menu item label as “x”. Then in your non-logged-in menu you can add page B but also set the menu item label as “x”.

    I hope this makes sense.

    Kadence Themes

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Showing pages depending upon user logged in or not’ is closed to new replies.