add image in dropdown select
add image in dropdown select
add image in dropdown select
The following should work, if I understand what you want correctly. Basically the only change is where you display the list items – instead of echoing it, you save it to the array. We also know the store type at that point, so we can save them both in their own array as a new … Read more
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>’; } }
I think your best shot would be to use a javascript-enhanced selectbox like select2 and an ajax-action to search for options. Right now, i don’t have the time to write actual pseudo-code for you, but i guess this link should give you the direction: https://select2.org/data-sources/ajax
One way of doing this would be to set a cookie when the user selects which menu they want to view, and on all page visits, check the cookie to see which menu they chose, and display the menu that matches their selection. A cookie can be set using JavaScript on the client side, while … Read more
I cannot create a complete solution here, because it’s kinda a ‘work for me for free’ question. I can (globally) tell you how to accomplish this. wp-admin –> courses CPT –> add a metabox ‘select teacher(s)’. Collect the teachers with get_posts(). Save the selected teachers as meta, use update_post_meta($course_post_id, ‘assigned_teachers’, $assigned_teachers) in metabox save function. … Read more
SOLVED: I used the premium plugin “Woocommerce Extra Product Options” (https://themehigh.com/product/woocommerce-extra-product-options) Thanks
You need to identify the tables for each of the columns that have the same name. You should also be using an IN statement and not = for the department. I can’t test this since I don’t have your DB but you can try this: $sql = $wpdb->get_results(“SELECT * FROM ” . $wpdb->prefix . “dir_personnel … Read more
You can achieve this by adding an onchange event to your select tag. Try the code below: HTML: <select id=”derselect” onchange=”this.className=this.options[this.selectedIndex].className” class=”green”> <option class=”green”>Test 1 <option class=”red”>Test 2 </select> And your CSS: .green { color:green} .red {color:red} 🙂
You should have only 1 select. Before the “>” of each option you can add <?php echo ( $_POST[‘select1’] == ‘value’ ? ‘selected’ : ” ); ?>