301 Redirection After Comment

The below code redirects visitors to any page that you want. // Redirect to thank you post after comment add_action(‘comment_post_redirect’, ‘redirect_to_thank_page’); function redirect_to_thank_page() { return ‘https://example.com/thank-you’; } However, I use WP Multisite feature and the same active theme is used by all subsites in the network. So can I redirect visitors according to the subsite…

Display queried posts in a custom post type & taxonomy loop template

I have two custom post types (‘services’ and ‘case_studies’) which one of them (services) is a taxonomy to the other (case_studies). My goal is to display a list at the bottom of ‘single-services.php’ to display/get all the posts (case_studies) that ‘this service’ was tagged. This is what I got so far: <ul class=”projects-worked-list”> <?php if…

How to get specific attribute from DB

a:3:{ i:0;a:2:{s:21:”wwsd_percent_discount”;s:2:”10″;s:25:”wwsd_minimum_discount_qrt”;s:2:”20″;} i:1;a:2:{s:21:”wwsd_percent_discount”;s:2:”20″;s:25:”wwsd_minimum_discount_qrt”;s:2:”50″;} i:2;a:2:{s:21:”wwsd_percent_discount”;s:2:”30″;s:25:”wwsd_minimum_discount_qrt”;s:3:”100″;} } I want to get 10, 20, 30 from wwsd_percent_discount. I wrote this code: $getId = $product->get_id(); global $wpdb; $result = $wpdb->get_results(“SELECT meta_value FROM $wpdb->postmeta WHERE post_id=’$getId’ AND meta_key =’wwsd_wholesale_discount_data'”); if ( !empty( $result ) ) { foreach ( $result as $r ) { echo “<br>”.$r->meta_value; } }