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

| 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

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.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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