I am unable to fetch json data from wp_db

$user1 = $wpdb->get_results(“SELECT * FROM diary_user_form_storage”); foreach ($user1 as $key => $value) { $productString = stripslashes($value->product); $product=json_decode($productString,true); $error_p = implode(‘ ‘, $product[0]); echo $error_p; } Out will be PRODUCT 2 PRODUCT 5

Appending an ACF custom field to the page title

If you need to append something to EVERY post_title you have, you should: Make your loop with WP Query, check Codex Then, use get_the_ID, to get the specific post ID, check Codex Then, use the ID to get the ACF field from that specific post like get_field(‘name-of-the-field), check the documentation Don’t forget to use wp_reset_query(), … Read more

WordPress desktop app shows blank screen

I noticed there was a newer version of WordPress Desktop App (v3.1.0) and when I tried to install it the installer said it could not update a file. I know from previous experience that this often means that the wordpress desktop app was still running in the background (even after I closed it). To me … Read more

Post content not showing

Your query is structured a little weird. $my_query = new WP_Query( array( ‘posts_per_page’ => 5 ) ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $the_query->the_post(); // Your desired template code } // Close while() // Restore original Post Data wp_reset_postdata(); } // Close if() This should be all you need to set … Read more

Hook for single product thumbnail

Here’s what I believe is an updated version of one of the other answers’ comments. This function replaces the width and height attributes, but OP wanted to change the src. I imagine the solution would be similar, except using preg_replace to replace the src instead. add_action(‘woocommerce_single_product_image_thumbnail_html’,’remove_single_product_image_attrs’,10,2); function remove_single_product_image_attrs( $sprintf, $post_id ){ return preg_replace( ‘/(width|height)=”\d*”\s/’, “”, … Read more