How could i add username field in WooCommerce

// Add Username Field to Registration Form add_action( ‘woocommerce_register_form_start’, ‘custom_woocommerce_register_username’ ); function custom_woocommerce_register_username() { ?> <p class=”form-row form-row-wide”> <label for=”reg_username”><?php _e( ‘Username’, ‘woocommerce’ ); ?> <span class=”required”>*</span></label> <input type=”text” class=”input-text” name=”username” id=”reg_username” value=”<?php echo ( ! empty( $_POST[‘username’] ) ) ? esc_attr( wp_unslash( $_POST[‘username’] ) ) : ”; ?>” /> </p> <?php } // Validate … Read more

has_term not returning anything

If your second code block is in the same code block as your first, then adding $post->ID as the third parameter of the has_term() call should fix it: if ( has_term( ‘closed-captions’, ‘accessibility-options’, $post->ID ) ) { echo ‘CC’; } If it doesn’t then as Tom mentioned, please update your question to include the surrounding … Read more

How do I group results from wp-query

Need to track the previous job title, and if it’s different, insert your line break. Untested: $prev_job_title = null; while ( $staff->have_posts() ) { $staff->the_post(); $job_title = get_post_meta( get_the_ID(), ‘job_title’, true ); if ( $prev_job_title !== $job_title ) { printf( ‘<h2>%s</h2>’, esc_html( $job_title ) ); $prev_job_title = $job_title; } // Staff markup. }

tech