Is there a way to read JSON data inside Custom Fields without editing PHP? [closed]

Yes. Use JSON.parse($string); to convert your string value to JSON format within Javascript. <script> var json_data_string = ‘{“data”:[“string no 1″,”string no 2″,”string no 3”]}’; // or echo the json_data field as <?php echo $json_data; ?> var json_data = JSON.parse(json_data_string); // Now access the properties as $data = json_data.data; // outputs: string no 1,string no 2,string … Read more

Set new url from custom post field

It sounds like the custom_url_posts_event function you’ve written is not being called by WordPress when generating the permalink for a post. This may be because the add_filter call is not properly hooked into WordPress or because the custom_url_posts_event function is not registered correctly with the post_type_link filter. To fix this, you should first ensure that … Read more

Archive for custom fields?

WordPress does not support by default custom_fields archive like for taxonomies (yeah, taxonomies can have categories) but we can create a destination page with page template (linked from the listed custom_field) and added a searching on the custom_field, like this (from the listing page): <?php if (get_post_meta($post->ID,’_my_meta’,TRUE)) : $key_meta = get_post_meta($post->ID,’_my_meta’,TRUE); endif; ?> <a href=”https://wordpress.stackexchange.com/questions/92473/<?php … Read more