I have a custom post type called ‘software’, contained within are various custom fields such as subtitle, price, screenshots, download link, etc. I created a function to allow use of the tinyMCE edit window for some of these custom fields. I have been trying to display these fields on the page but with no success.
The method I’m using is this:
<h1><?php the_title();?></h1>
<h3><?php echo get_post_meta(get_the_ID(), 'subtitle', TRUE); ?></h3>
Here is a link to the page.
Below the <hr/>
on the page is a list of all the meta created. The ONLY one of the fields which will display is ‘price’ for some strange reason.
Anyone have any idea what I’m missing?
Well, you are using:
So, you are saying to WordPress to get the meta value of the ‘subtitle’ field and that the returned value be in format of string. See get_post_meta() docu.
To get all meta data of a post you should use get_post_custom() function instead. For example, if you are inside the loop:
This will return all meta data of the post. If you want to check, for example, the “price” meta field:
use this code for solving your problem.