WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to create an "Alert" button that can be turned on and off thru wp-admin. Of course the "Alert" button im asking for is to be published at the main page, but can only be turned on when its needed.

Im using wordpress with jqueryMobile for your information.


Its pretty hard to explain this. But i found this plugin and it does what im after. Except this plugin show the notification on everypage - even wp-admin.

To the question:

Is it possible to create a notification/menubar that can be tunerd on/off from wp-admin. The idea behind this is to show important "news" whenever.?

Whats the best solution?

share|improve this question
I don't understand what the code you posted has to do with the description of what you are trying... If you want like a checkbox in the admin area that will be used to enable/disable something in the frontend, take a look at the Settings API. So, in your template you'd have if(get_option('alert_button')) echo 'Alert!';. – brasofilo Jan 22 '13 at 14:10
Yeah something like that. Lets say i have 4 menu buttons. I want the 5th page just to "be turned on" when i need to it show within the 4 button. Do you understand ? With other words, it will always excist in wp-admin i just need to activate and deactivate control. – M3o Jan 22 '13 at 15:33
Research using the hints I gave and upgrade the Question, what you ask ain't difficult, but that downvote (not mine) clearly indicates the Q needs improvement. – brasofilo Jan 22 '13 at 17:13
Thanks you! Im already lookin in to it. And the question is now updated. – M3o Jan 23 '13 at 9:23
up vote 0 down vote accepted

Using the very example from the Codex in the Settings API section. Put it in the theme's functions.php:

add_action('admin_init', 'eg_settings_api_init');

function eg_settings_api_init() {
        'Example settings section in reading',

        'Example setting Name',


function eg_setting_section_callback_function() {
    echo '<p>Intro text for our settings section</p>';

function eg_setting_callback_function() {
    echo '<input name="eg_setting_name" 
        class="code" ' 
        . checked( 1, get_option('eg_setting_name'), false ) 
        . ' />Explanation text';

This creates a checkbox in Settings > Reading:
settings api

And in the theme header.php file, it can be used to render a big red warning banner:

    if( get_option('eg_setting_name') ) {
        echo '<h1 style="background-color: #fcc;width:100%;height:3em;line-height:3em;text-align:center;top:40px;position:fixed">
share|improve this answer
Thank you for your time , this worked! – M3o Jan 23 '13 at 13:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.