get post meta name
-
I am using the code
<?php $key="property_type"; echo get_post_meta($post->ID, $key, true); ?>which is working but it is giving me the slug and not the long name. such as exclusive_properties instead of exclusive properties without the underscore.How do I get this code to pule the name without the underscore thank you.
-
This topic was modified 9 years, 2 months ago by
Steven Stern (sterndata). Reason: moved from "everything else" to "developing"
-
This topic was modified 9 years, 2 months ago by
-
What plugin/theme are you using that stores this meta? What I’d do is look at all the meta values stored for that post and see if there’s a more suitable one to use. If not, then I’d use strreplace to replace _ with a blank.
I am using the WP Property Plugin and that seams to be the meta value that it is in. It does show the value within the admin area not having the _ I just cant figure out how to pull that one and not the one with the underscore.
How would I use the strreplace to remove the underscore with my code
<?php $key="property_type"; echo get_post_meta($post->ID, $key, true); ?>I have not used that before for thishttp://php.net/manual/en/function.str-replace.php
with respect to the specifics of that plugin, the developers and users of this plugin would be the best people to ask. You can reach them here:
The topic ‘get post meta name’ is closed to new replies.