Custom Meta Box (SELECT) Not Saving

So I figured out a work around by butchering this and placing in parts from other solutions found online. This is the code I got working correctly. functions.php: /* ** START ** ADDS A NEW META BOX TO PAGES */ // register the meta box add_action( ‘add_meta_boxes’, ‘my_custom_field_cityselect’ ); add_action( ‘load-page.php’, ‘my_custom_field_cityselect’ ); add_action( ‘load-page-new.php’, … Read more

adding extra wordpress user info from registration form

You can use usermeta wordpress function to add extra information for user, below code will help you function crm_wp_insert_user() { if ( isset($_POST[‘crm_customer_submitted’] ) ) { $firstname = sanitize_user( $_POST[‘firstname’] ); $lastname = sanitize_user( $_POST[‘lastname’] ); $project = sanitize_user( $_POST[‘project’] ); $email = sanitize_email( $_POST[’email’] ); $phone = sanitize_user( $_POST[‘phone’] ); $address = sanitize_user( $_POST[‘address’] … Read more

Advanced search by two criteria – sort by location and date (ascending or descending)

I finally found a solution. For those who might also stumble on this. What I had to do is to put ASC and DESC as option values for the date sorting. I read in the documentation that WordPress uses these values by default to sort data. <select class=”dropdown-class” name=”order” id=”sortbox”> <option value=”DESC”>Newest</option> <option value=”ASC”>Oldest</option> </select> … Read more

Add image to menu item with ACF

get_field() gets the field for the current post in the loop, but the loop isn’t used for menu items, so you need to specify which post you want to get the value from. In the case of menu items, each nav menu item is a WP_Post object, so you want to pass that: foreach( $items … Read more