WordPress Redirect / Add_Rewrite_Rule – Non Index.php Page

If company is the page slug try ‘index.php?pagename=company&code=$matches[1]’ If you want it in .htaccess to intercept it before it goes to index.php try ‘index.php?pagename=company&code=$1’ If company is a folder, there should be an index.php (or whatever the default file name is for your server) inside it that will process code.

Echo Option Value Based On WordPress User Role

Something like this? if(current_user_can(‘administrator’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; }elseif(current_user_can(‘subscriber’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; } Maybe this should be wrapped in a user logged in check like this: if(is_user_logged_in()){ if(current_user_can(‘administrator’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; }elseif(current_user_can(‘subscriber’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; } }

Inserting other fields to existing registration form in a WordPress theme

I figured out the fix on my own, after many try and errors. I just change this line of code: $status = wp_create_user( $username, $password, $email ); to this: $status = wp_insert_user( array (‘first_name’ => $first, ‘last_name’ => $last, ‘user_pass’ => $password, ‘user_login’ => $username, ‘user_email’ => $email, ‘phone’ => $user_phone, ‘role’ => ‘subscriber’ ) … Read more

Help on Wp_query to print an term

If you want to output/print the term name look at this within the loop: https://developer.wordpress.org/reference/functions/get_the_terms/ $terms = get_the_terms( get_the_ID(), ‘pwb-brand’ ); You will need to output within the loop similar to this: <?php $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); $terms = get_the_terms( get_the_ID(), ‘pwb-brand’ … Read more