Jump to content

PHP insert taxonomy (hey that rhymes!)


Planetdune

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.