Forums

Display a link only to admin user level (5 posts)

  1. pad
    Member
    Posted 3 years ago #

    Hi,

    On my site I have a poll, I'd like to add an "Edit poll" link to the homepage which ONLY logged in, registered admins can see.

    Is this possible with some code?

  2. pad
    Member
    Posted 3 years ago #

    No one? :-(

  3. phejster
    Member
    Posted 3 years ago #

    I know this isn't exactly what you're looking for but it might be a starting point for you - it will let any logged in user see the link

    <?php if (is_user_logged_in()) { ?><a href="LINK-GOES-HERE">LINK-TEXT</a></li><?php } ?>

    You could also check out this page for a possible solution.

  4. pad
    Member
    Posted 3 years ago #

    That does the job :) Thank you!

  5. guruconsulting
    Member
    Posted 3 years ago #

    if you want to test admin logged in, then you can do this:

    <?
    global $userdata;
    get_currentuserinfo()
    if($userdata->user_level>9){ // do your thing }
    ?>

    [Signature moderated. Please read the forum rules!]

Topic Closed

This topic has been closed to new replies.

About this Topic