CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
PHP Problems
[Solved] get post meta php help
fectio1
Permalink to comment
#
January 2012
I am using a custom field and need it to echo some text, plus the custom field content if it is true. If not, it does nothing. An example would be
Fax Number: ===> the text I want echoed if the field is true
555-555-5555: ===> the custom field if true
Here is what I got. I have tried some variations with "if" and "else" which did not work.
<li><?php echo get_post_meta($post->ID, 'fax_number', true); ?></li>
Thanks.
fectio1
Permalink to comment
#
January 2012
found my answer :)
Add a Comment
Fax Number: ===> the text I want echoed if the field is true
555-555-5555: ===> the custom field if true
Here is what I got. I have tried some variations with "if" and "else" which did not work.
Thanks.