Can’t save meta field value if the title not set
Can’t save meta field value if the title not set
Can’t save meta field value if the title not set
Assuming you are using post_meta this should help:: $color=”red”; $the_query = new WP_Query(array( ‘meta_key’ => ‘color’, ‘meta_value’ => $color ));
//Your color codes $str1 = “000000 f0f0f0 c0c0c0 202020 404040 “; $str2 = “0000ee 555333 cc0000 602040 003399 “; $str3 = “9999cc 0000cc 0099ff 204010 552299 “; $str4 = “406040 ffffff ffcccc 000000 202020 “; $str5 = “cc0000 99ffcc cc9900 ff9999 000000 “; //creating an array and merging all codes $final_arr = array_merge( explode(” “,$str1),explode(” … Read more
Custom Metabox Always shows box and checked
After some practice, I found two ways to do this prettier: As a text widget: You just have to define a widget area in your template. After this, in Appearance>Widget, you can add a “Text” widget in this area, with any free HTML code. It can do the trick for the ones who write HTML … Read more
Not entirely sure, but looks like WordPress doesn’t have a method to update custom fields in batches, so, 1 query to the DB per field.
Got it – just use this: <?php $query = new WP_Query( array( ‘tag__in’ => $tags ) ); ?>
get_queried_object_ID() will return the ID on the page for posts, or get_queried_object() will return the page object containing all its post fields. Alternately, the ID of the blog page is stored in the option page_for_posts, which is internally how get_queried_object gets the ID of the post object to load.
Simply you need to replace the_field(‘video’) with get_field(‘video’). Why? Because according to ACF documentation; get_field($field_name, $post_id, $format_value) Returns the value of the specified field. Whereas on the other hand the_field($field_name, $post_id) Displays the value of the specified field. (this is the same as “echo get_field($field_name)”) Hope this might help others as well.
There is no comment_ID until you are in the foreach loop. Try: $comments = get_comments($args); foreach($comments as $comment) : echo ‘<div id=”‘ . $comment->comment_ID . ‘”>Agent Name ‘ . $comment->comment_author . ‘Phone’ . $comment->comment_phone . ‘Reply’ . $comment->comment_content . ‘</div>’; echo get_comment_meta( $comment->comment_ID, ‘agents_condition’, true ); endforeach;