Forums

How do I add key name not value (1 post)

  1. toyfruit
    Member
    Posted 2 years ago #

    Hi all - I'm new to WordPress (only be using it a couple of hours), but I was wondering how can I add the name of a key from the custom fields box to my page?

    I can get the value of the key by using <?php echo get_post_meta($post->ID, "Name", $single = true);?> but I don't know how to display the actual name of the key (in this case 'Name').

    I want to be able to get both the name of the key and the value, so I can style each one separately. So for example it may appear like 'Name: Joe Bloggs'.

Topic Closed

This topic has been closed to new replies.

About this Topic