riddlu
Forum Replies Created
-
Forum: Plugins
In reply to: Admin Link Menu Bar only visible to AdminBut I dont’ understand why content of function
is_adminapears 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?
Forum: Plugins
In reply to: Admin Link Menu Bar only visible to AdminOk, 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="http://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.Forum: Themes and Templates
In reply to: Admin-only parts of layoutmoshu: 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. 🙂