Hello
I have created a custom post type and and custom meta data, everything works fine except in category page, the custom meta values does not show the corrected value.
in the post listing , the custom meta values only show the value of first post. Below are two links you cna check, in first the number of days are shown from first post only.
hidden link
hidden link
Both are pages are category pages, in the first link, the number of days are showing as 2 nights/3 days, which is only for forst tour packages, for the rest of the tour packages it shown be different but here it is showing the value of the first only.
In the second link where there is only one package, it is showing correct /changed duration.
The code I am using is
This is how I am storing the value of the field in a variable
<?php $noofdays = types_render_field("no-of-days", array("output"=>"raw")); ?>
and I am printing euse the below code
Thanks in advance
Dear Anuj,
It sounds like the global $post variable doesn’t have the correct value.
Can you post the code around that? Specifically the code for the loop.
Regards,
Caridad