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

Ideally I am looking for two text boxes added to the 'Add new post' admin page, and the data from those two boxes be displayed in the sidebar when viewing the post page. So the sidebar displays the data belong to the post.... Two widgets for each post. Possible?

Thanks a ton in advance!

share|improve this question

You should take a look into creating custom meta boxes to display the text fields in the admin & then save that data as post meta. There are many tutorials available online for this

Once you have the information, you can put a get_post_meta call in your theme's sidebar.php file & display the data there directly. If you want it in widget format, you'll have to create a custom widget to display the meta information. Again there are many tutorials available online for this.

When displaying the info you can add a condition like

if(is_single() && 'post' == get_post_type())
    echo get_post_meta(get_the_ID(), 'custom-field-key', true);
share|improve this answer

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.