WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Meta Section (sidebar) (3 posts)

  1. thornomad
    Member
    Posted 8 years ago #

    I wondered if there was a way to only show the meta section on my sidebar on machines that I have logged in as the admin on ? The information is helpful to me, but I would rather it not be there for the casual viewer.

    Thank you.

  2. mylagoon
    Member
    Posted 8 years ago #

    This is some pretty old coding, and I personally havn't tested it myself, but it sounds like it may work for you.

    <?php
    global $HTTP_SERVER_VARS;
    global $user_level;
    get_currentuserinfo();
    if ($user_level < 1) {
    include('public.php');
    }
    else {
    include('private.php');
    }
    ?>

    You'll obviously have to customize it to suit your needs, but with some basic PHP knowledge it shouldn't be hard to integrate. It would be interesting to see if it works.

    Original code posting found here:
    http://wordpress.org/support/topic/9250

  3. thornomad
    Member
    Posted 8 years ago #

    Thanks, that worked perfectly; I did modify it slightly ... I got rid of the include and just put the code directly in the sidebar.php file; still, I am only getting the meta section on my logged in machine. Thanks!

    D

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags