How to query posts by meta keys AND under specific category?

Are you using a checkbox or similar for the ‘acf_platform’ field using ACF for more than one selection? Advanced Custom Fields stores these as a serialised array, so a meta_query with ‘compare’ => ‘=’ may not work. The ACF documentation suggests using ‘compare’ => ‘LIKE’ $args = array( ‘meta_query’ => array( array( ‘key’ => ‘field_name’, … Read more

Testimonials/Reviews for Products

The most frequent approach would be to create a new “review” or “testimonial” Custom Post Type (“CPT”) with a plugin or in your theme‘s functions.php file (or a new child theme‘s functons.php file, if your current theme is not custom-built), and then alter your product page template to use a secondary loop to display your … Read more

Use contact form for reviews

First add 1-5 * (star) Radio button on comment form. add_action( ‘comment_form_logged_in_after’, ‘add_review_field_to_comment_form’ ); add_action( ‘comment_form_after_fields’, ‘add_review_field_to_comment_form’ ); function add_review_field_to_comment_form () { echo ‘<p class=”comment-form-rating”>’. ‘<label for=”rating”>Rating</label> <span class=”commentratingbox”>’; for( $i=1; $i <= 5; $i++ ) echo ‘<span class=”commentrating”><input type=”radio” name=”rating” id=”rating” value=”‘. $i .'”/>’. $i .'</span>’; echo'</span></p>’; } Now save the Rating value to … Read more

Add button linked to single product page on order detail page

The woocommerce_order_details_after_order_table hook receives the WC_Order object as the $order argument. This means you can get the items from the order with $order->get_items(). That will return an Array of WC_Order_Items. From this you can get the associated product of the first item, which you can use to get its permalink, to which you can append … Read more

WordPress product review

First you would create a custom post type “products”, you can use Custom Post Type UI for this. You can also do it by hand. Then you would create custom fields for the products, you can use the excellent ACF for this. Here’s some resources from the WordPress codex.

WooCommerce Review Author Hook on Review Submission

Found it! Go to wp-includes > comment-templates.php. Edit around line 2560: else ( ! is_user_logged_in() ) { to else { Then in my plugin .php file or your Theme ‘function.php’, add: function modify_author($commentdata) { $commentdata[‘comment_author’] = $_POST[‘author’]; // You should sanitize this. return $commentdata; } add_filter(‘preprocess_comment’, ‘modify_author’); I know it’s bad idea to modify comment-templates.php, … Read more

Limit review by e-mail

This question should really be directed to the Woocommerce support but it doesn’t really sound like Woocommerce is the right solution here. Create a plugin and in the plugin, create a custom post type called companies. Using something like https://generatewp.com/post-type/ will help you get started quickly. Then you want to look at implementing your own … Read more

error code: 523