The custom field is displayed as local, but not in the production environment.
Custom field settings are arranged locally and in production.
Custom field Field name: temp-info Type: Select Choices yes: Yes no: No
<? php $temp_info = get_post_meta (get_the_ID (), "temp-info", true);?> <? php if ($temp_info == "yes"):?> <section> "> "> </section> <? php endif;?>
var_dump ($temp_info) the_field ('temp-info')
When you execute, the value changes locally.
string (3) "yes" yes
However, the value does not change in production.
string (0) ""
In such cases
What other methods should I use to find the cause?
Answer # 1
The problem is in the function of another partial loop
It was because ID was not correctly acquired by get_the_ID () because it was not described.
(Because I kept other ids)
I was looking for problems locally, but I learned that
wp_reset_postdata ();is very important.
- wordpress - i want to specify the save destination of the custom field file
- php - the map input field of wordpress is not displayed
- wordpress - wp multisite custom field naming
- php - in wordpress article sort, sort at the end if the custom field is blank
- images are not displayed well in custom html of wordpress widget
- wordpress - i want to reflect the contents of the custom field on the post list page
- php - to use custom fields in the wordpress theme "customizr"
- wordpress - the list for each category is not displayed, but the list of all posts is displayed
- html - although it is displayed correctly in the production environment, i want to find out the cause that the display is broken
- how to edit comment field in bbpress of wordpress
- i want to fix the code in the wordpress production environment
- i want to add an item to a comment in a custom field and output all the results to singlephp
- wordpress - how to display advanced custom fields subfield images?
- wordpress - questions about wp custom fields search
- is it possible to set the number of articles displayed on the top page of the wordpress theme xeory extension to 10 articles whe
- the line breaks entered in the text area of the custom field on the wordpress edit screen are automatically deleted one by one
- wordpress - the second and subsequent pages of the custom post archive are all the same as the first page
- wordpress - i want to display a custom post type in the specified number
- the decoration button is not displayed in the wordpress visual editor
- php - how to display the contents of a custom field from another database?