WP_Query, ACF field and array
OK, I solved in this way: ‘meta_query’ => array( array( ‘key’ => ‘product’, ‘value’ => ‘”‘.get_the_id().'”‘, ‘compare’ => ‘LIKE’ ) )
OK, I solved in this way: ‘meta_query’ => array( array( ‘key’ => ‘product’, ‘value’ => ‘”‘.get_the_id().'”‘, ‘compare’ => ‘LIKE’ ) )
Custom Fields Not Showing (ACF not installed)
I fixed your input type/sanitization and escaping issues. I think there’s still some cleanup that could be done with this code though. I see inputs without labels, invalid attributes, etc. add_action( ‘add_meta_boxes_post’, function ( $post ) { if ( $post->_wp_page_template === ‘page-templates/skyscraper-post.php’ ) { add_meta_box( ‘sky_post_excerpt’, ‘SkyScraper Post Excerpt and Links’, ‘sky_post_excerpts’, ‘post’, ‘advanced’, ‘high’ … Read more
Sort custom post archives by a meta value from a different custom post type?
You should use the filter to show the description. Try to replace $your_description with the custom field value. $content = apply_filters(‘the_content’, $your_description); echo !empty($your_description) ? $content : __(‘Nothing to show!’, ‘your_textdomain’);
Eventually came to a solution in case anyone needs it: function mb_get_user_meta_values( $mb_user_meta_key ) { if( empty($mb_user_meta_key) ) return; $mb_get_users = get_users( array( ‘meta_key’ => $mb_user_meta_key ) ); $mb_user_meta_values = array(); foreach( $mb_get_users as $mb_user ) { $mb_user_meta_values[] = get_user_meta( $mb_user->ID, $mb_user_meta_key, true ); } $mb_user_meta_values = array_unique( $mb_user_meta_values ); return $mb_user_meta_values; } Then I … Read more
You can change the value for home_banner_text as follows. Make ACF field visible on homepage admin area Go to Custom Fields -> Field Groups. Find field group which has the home_banner_text field. In that field group, scroll down to Location tab/section. Update in Show this field group if, Page is equal to Your Home/Front Page … Read more
update a custom field with the value of another existing custom field
Store comment form custom field in custom database
You make a few mistakes in your code. To query posts by category you can use category_name [ref] or tax_query [ref] in query parameters. // category_name / cat / category__and ‘category_name’ => ‘event’, ‘tax_query’ => [ [ ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘event’, ] ], ACF checkbox are stored in custom field, … Read more