Planetdune Posted March 28, 2018 Share Posted March 28, 2018 Hello I am trying to insert the value of a taxonomy using php. In the past I used a custom field for this but I am switching to a taxonomy. This was my code when using the custom field which works fine: $name = wcpt_get_name( $product ) . '</br><i>' . get_post_meta( get_the_ID(), 'Province', true ) . '</i></td>'; The custom field was called "province". Now my (custom) taxonomy is called "country". How do I use it instead of the custom field? Thank you! Link to comment Share on other sites More sharing options...
Planetdune Posted March 28, 2018 Author Share Posted March 28, 2018 To be clear, it is only this part that needs changing, the rest may stay the same: . get_post_meta( get_the_ID(), 'Province', true ) . Link to comment Share on other sites More sharing options...
taquitosensei Posted March 29, 2018 Share Posted March 29, 2018 Taxonomy is a wordpress question more than php. Here's wordpresses information on taxonomy. https://codex.wordpress.org/Taxonomies Hello I am trying to insert the value of a taxonomy using php. In the past I used a custom field for this but I am switching to a taxonomy. This was my code when using the custom field which works fine: $name = wcpt_get_name( $product ) . '</br><i>' . get_post_meta( get_the_ID(), 'Province', true ) . '</i></td>'; The custom field was called "province". Now my (custom) taxonomy is called "country". How do I use it instead of the custom field? Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.