Adding a checkbox field to a (custom) taxonomy
Fortunately this guy has written a great taxonomy class to solve all of this 🙂 https://en.bainternet.info/wordpress-taxonomies-extra-fields-the-easy-way/
Fortunately this guy has written a great taxonomy class to solve all of this 🙂 https://en.bainternet.info/wordpress-taxonomies-extra-fields-the-easy-way/
Save, update, get and sanitize post meta as HTML not plain
Pre_get_post custom taxonomy combined with custom fields?
get_previous_post_link and get_next_post_link of custom post type that share custom field value
Turns out it was an issue with not providing a geocode API! I needed to change $geocode=file_get_contents(‘https://maps.google.com/maps/api/geocode/json?address=”.$prepAddr.”&sensor=false’); to $geocode = file_get_contents(‘https://maps.google.com/maps/api/geocode/json?address=”.$prepAddr.”&key=’.$api_key); In other words, there needs to be the key parameter with the API key in that URL. I also removed the sensor parameter, as that does not appear to be needed.
If I’ve understood this correctly, the answer is a simple one. If these are both in the same class, set a property on your class for storing the output of the first function that runs. From there, any subsequent functions can access the data stored on that property.
What you want to do is access the query_vars and use them. Base code: Page to access the fields $custom_field = get_query_var(‘custom_field’); var_dump($custom_field); And the function or custom plugin to save the magic: add_filter( ‘query_vars’, ‘my_custom_query_vars’ ); function my_custom_query_vars( $vars ) { $vars[] = ‘custom_field’; $vars[] = ‘custom_awesome_field’; return $vars; } yourawesomesite.awesome/?custom_field=white string ‘white’ (length=5)
Solved! The problem was Database Caching (for casual users) in the W3 Total Cache. Since most of the meta-data were added “on the fly” to the custom post type structure, they were not immediately accessible to wp_mail() or other methods. I have now disable DB Caching and the plugin is working fine.
You can try the date() function: $date = get_post_meta($post->ID, ‘event_start_date’, true); $day = date(‘d’, strtotime($date)); //01-31 Another way will be DateTime: $date = get_post_meta($post->ID, ‘event_start_date’, true); $date = DateTime::createFromFormat(‘Y-m-d’, $date); $day = $date->format(‘d’);
Sort loop by custom field from different post type