Conditional display based on ACF checkbox
Conditional display based on ACF checkbox
Conditional display based on ACF checkbox
save all acf options in one meta_value [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
The good thing about ACF is it comes with lots of functions to check fields. Here is the manual. Are you creating a meta value in addition to the field and it’s value? I’m guessing that you are looking for the value of the bloom field. If that’s so then get_field(‘bloom’,post->ID) should be what you’re … Read more
How to make donation button dynamic on chariti theme [closed]
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
It looks to me like the_sub_field echoes content. It is never returned for substr to work on. You need get_sub_field. $givchars = 5; $postgiv = get_sub_field(‘get_involved_text’); $modgiv = substr($postgiv, 0, $givchars); echo ‘ ‘ .$modgiv. ‘ ‘;
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
If you are uploading via Core admin pages, WordPress will most likely upload the file, and then create an attachment post– that is, a post with the attachment post type. So the save_post_attachment hook might do it for you. 3362 /** 3363 * Fires once a post has been saved. 3364 * 3365 * The … Read more
Add fields to edit in custom widget