Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • But I dont’ understand why content of function is_admin apears on the site. Why it is visible, instead of be parsed by PHP and used in conditional statement in sidebar.

    Can you copy&paste me your function hiding content from non-admin and non-user, and way of using it?

    Ok, I’ve got some problems using chuckg’s solution.

    I put this function into my-hacks.php, activated it in wordpress’s backend and put file into blog root directory.

    function is_admin () {
    global $user_level;
    get_currentuserinfo();
    if ($user_level == 10) { return true; }
    else { return false; }
    }

    I try to summon it in sidebar.php:

    <?php if (is_admin()) { echo '<ul><li>'; wp_loginout(); echo '</li><li><a href="/blog/wp-admin/">Admin Panel</a></li><li><a href="/blog/wp-admin/post.php">Add post</a></li><li><a href="https://stat.4u.pl/?******">Stats</a></li></ul>'; } ?>

    And at the top of my blog whole function appears, shifting rest of content.

    Can you probably help me with other, easier solution? Sth similar to smarty-like <ADMIN_BLOCK></ADMIN_BLOCK>. Or help to debug that function / way of using it.

    Thread Starter riddlu

    (@riddlu)

    moshu: Thanks, that’ll help with admin.
    MichaelH: Well, I’m interested in sth like moshu adviced. Not full pages, unfortunately. I’ll try to modify that code.

    Thanks guys for help; my first steps to wordpress. ??

Viewing 3 replies - 1 through 3 (of 3 total)