Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to add a "status" to my wordpress blog. My definition of status is a piece of text that say something about the blog that could be changed every day or not changed in month and completely independent of blog posts and pages. For example, in my case I need to add a brief description of the city I am while travelling. Any plugin or similar to do this?

Note: Text widget is not an option because I have to control where to put this information, ideally through a PHP call

share|improve this question
    
You want an interface where you can set the blog status? You can use the WordPress Option API to store and display your blog status. –  Hameedullah Khan Jan 22 '12 at 10:26
    
Maybe, but I've never worked with Option API, so I don't know where to start.. –  Ivan Jan 22 '12 at 10:30

1 Answer 1

up vote 3 down vote accepted

You can use the option API to set the blog_status and then display it. If you want to use blog description for the purpose you already have the UI available to set it from Setting->General and set the tag line to update your blog status.

Then you can display the tag line anywhere in your theme template using the following:

echo get_option( 'blogdescription', 'Default status message' );

But if you are using blog description somewhere else and want a dedicated option for the blog status purpose then you can use the update_option like in the examples below to set and display the blog status.

To set the blog status:

update_option( 'blog_status_message', 'This is pretty cool blog status message' );

To display the blog status:

echo get_option( 'blog_status_message', 'The default status message' );

For more information on Options API.

share|improve this answer

Your Answer

 
discard

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.