mohansinfh — 2012-03-11T06:39:38-04:00 — #1
I want to display a message in a plugin in public area of site, if admin is logged in,
and another message, if anyone else (other than admin) is logged in.
Can someone please give me idea or show me an example, how to code that ?
mohansinfh — 2012-03-11T07:06:07-04:00 — #2
I think i have not provided enough info in question.
samanime — 2012-03-11T08:13:22-04:00 — #3
You can do something like:
<?php if(current_user_can('edit_users')) : ?>
<?php else : ?>
<?php endif; ?>
mohansinfh — 2012-03-11T12:01:07-04:00 — #4
Hi, Thanks for your valuable information.
mohansinfh — 2012-03-11T12:29:28-04:00 — #5
Sir, Can you please help me in one more thing, I need to get the value of a variable on top of the page, which is declared and defined in bottom of that page.
samanime — 2012-03-12T11:07:13-04:00 — #6
Declare it at the top? =p
You can't use it until it's declared, so you'll have to move it.