How to display Custom Field in sidebar?

Discussion in 'Blogging' started by wolfmmiii, Oct 13, 2010.

  1. wolfmmiii

    wolfmmiii Junior Member

    Jul 13, 2008
    Likes Received:
    Hello all...

    I've been Googling for a while and can't seem to find an elegant solution.

    What I'm trying to do is create a custom field for each post (Wordpress) and then display the value of that custom field in the sidebar whenever that post is viewed.

    It seems like it should be simple enough but maybe not?

    Anyone know how to do this?
  2. trapmuzik

    trapmuzik Junior Member

    Mar 20, 2009
    Likes Received:
    the short answer is yes its possible but no its not simple... the reason is because wp data for each post is usually only accessible in the loop and the sidebar would be out of the loop. you would need to store the post id in a varialbe (assuming you know php) and then pass it to get_post_meta function of wp in the sidebar and then show the value.