Hiding Dropdown Fields
Hiding Dropdown Fields
Hiding Dropdown Fields
If you’re looking for raw SQL query, then this should help: UPDATE <PREFIX>postmeta SET meta_value=”temp4″ WHERE meta_value=”temp1″ AND meta_key = ‘post_template’ If you want to run this query from WP, then you can use this: global $wpdb; $wpdb->update( “{$wpdb->prefix}postmeta”, array( ‘meta_value’ => ‘temp4’ ), array( ‘meta_key’ => ‘post_template’, ‘meta_value’ => ‘temp1’ ) );
Is there a way to tell which country you are in when viewing the site? I mean like is the domain name example.uk | example.ca | example.com/en … That kinda thing? Then you could search your domain for the string for that country: $protocol = stripos($_SERVER[‘SERVER_PROTOCOL’],’https’) === true ? ‘https://’ : ‘http://’; $url = $protocol … Read more
Thank you everyone for your help! In the end the query below got me the results I desired – which was to show and sort the posts by a custom field of “publication_date” first – sorting by the date, and if there were multiple of the same date (say, 4 marked June 2013), it would … Read more
Add square brackets to input names to get PHP to interpret them as an array of data instead of overriding the value with each new input. so your input will look like this: <input type=”text” name=”skills[]” id=”skills” value=”<?php echo esc_attr( get_the_author_meta( ‘skills’, $current_user->ID ) ); ?>” class=”textbox” /> <input type=”text” name=”skills_percent[]” id=”skills_percent” value=”<?php echo esc_attr( … Read more
Show Custom field value instead of title in WP Menu
Why does my numeric meta query work only on one meta key and not the other?
Custom Field URL + description
Custom Fields Not Showing (ACF not installed)
I fixed your input type/sanitization and escaping issues. I think there’s still some cleanup that could be done with this code though. I see inputs without labels, invalid attributes, etc. add_action( ‘add_meta_boxes_post’, function ( $post ) { if ( $post->_wp_page_template === ‘page-templates/skyscraper-post.php’ ) { add_meta_box( ‘sky_post_excerpt’, ‘SkyScraper Post Excerpt and Links’, ‘sky_post_excerpts’, ‘post’, ‘advanced’, ‘high’ … Read more