I have custom post type of jobs and in this post type I have two custom taxonomies. For job post I selected few terms from both these taxonomies in admin panel but when I tried to access these on front end using get_post_meta
it is displaying these terms as empty.
I have two taxonomies (city, industry). I am getting city terms like this
[_job_city] => Array
(
[0] =>
)
I am getting industry terms like this
[_company_industry] => Array
(
[0] => s:1:"1";
)
Any suggestion ?
I have custom post type of jobs and in this post type I have two custom taxonomies. For job post I selected few terms from both these taxonomies in admin panel but when I tried to access these on front end using get_post_meta
it is displaying these terms as empty.
I have two taxonomies (city, industry). I am getting city terms like this
[_job_city] => Array
(
[0] =>
)
I am getting industry terms like this
[_company_industry] => Array
(
[0] => s:1:"1";
)
Any suggestion ?
Share Improve this question edited Feb 7, 2020 at 17:09 wplearner asked Feb 6, 2020 at 23:11 wplearnerwplearner 4892 gold badges9 silver badges27 bronze badges 11 | Show 6 more comments1 Answer
Reset to default 1Instead of get_post_meta
now I am using wp_get_post_terms
function to access job post terms and it is working for me. It is working correctly for both these taxonomies.
get_terms()
and notget_post_meta()
.. – Sally CJ Commented Feb 6, 2020 at 23:16