WooCommerce is_product_category() not working

is_product_category() – Check If Current Page is a Product Category Try this add_action( ‘woocommerce_single_product_summary’, ‘product_short_description_by_category’, 20 ); function product_short_description_by_category() { if( has_term( ‘cake-toppers’, ‘product_cat’ )){ echo ‘A cake topper’; } else{ echo ‘NOT CAKE TOPPER’; } }

How can I properly loop through an array gotten from my wordpress database and display it to my site

Try this global $wpdb; $results = $wpdb->get_results( “SELECT * FROM $wpdb->posts WHERE `post_type`=’post’ AND `post_status` = ‘publish’ LIMIT 20″ ); foreach ($results as $result) { echo ‘<div class=”card”> <div class=”img”> <img src=”‘.get_the_post_thumbnail_url( $result -> ID, ‘thumbnail’ ).'” alt=””> </div> <div class=”info”> <h5>’.$result->post_title.'</h5> </div> </div>’; }

Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]

I saw in your code the $_POST[‘phonenumber’] doesn’t check isset so may be this is an error you try to find. I think you can try this if (!empty($_POST)) { global $wpdb; $table = “mytablenameplaceholder”; if(isset($_POST[‘name’]) && isset($_POST[’emailaddress’])){ $number1 = $_POST[‘name’]; $message = $_POST[’emailaddress’]; $message = urlencode($message); //process phonenumber $phonenumber=””; if(isset($_POST[‘phonenumber’])){ $phonenumber = $_POST[‘phonenumber’]; } … Read more

How do i post data to url with fields?

You have to build the array as the json array needs to be $args = array( ‘headers’ => array( ‘Content-Type’ => ‘application/json’, ‘Authorization’ => ‘Basic ‘.$apiKey ) ); $bdy = array( ‘fields’=> array( ‘project’ => array( ‘key’ =>’LD’ ), ‘summary’=> ‘CODING WORKS’, ‘description’ => ‘Creating of an issue using project keys and issue type names … Read more