radio button is checked but display not check

In the WordPress back-end you have to use checked=”checked” (stricter XHTML), because the CSS will not be applied otherwise: <input type=”radio” name=”colors” id=”blue” checked=”checked”> this is the CSS that applies the blue dot: WordPress already provides a function for this checked() <input type=”radio” name=”colors” id=”blue” <?php checked( ‘red’, get_option( ‘color’ ) ); ?> /> so … Read more

How to customize the Categories meta box to allow only one category?

Freed from comment; the asker really did not want to write an answer. :/ function convert_root_cats_to_radio() { global $post_type; ?> <script type=”text/javascript”> jQuery(“#activitycategorychecklist>li>label input”).each(function(){ this.disabled = “disabled”; }); jQuery(“#activitycategorychecklist>li>ul>li>label input”).each(function(){ this.type=”radio”; }); jQuery(“#activitycategory-tabs li:odd”).hide(); </script> <?php } add_action( ‘admin_footer-post.php’, ‘convert_root_cats_to_radio’ ); add_action( ‘admin_footer-post-new.php’, ‘convert_root_cats_to_radio’ );

Why is save_post hook not running?

Try this in your theme’s functions.php file, or a .php file of a plugin that you may be writing: add_action(‘save_post’, ‘xxx_save_meta_box’); function xxx_meta_box_callback() { add_meta_box(‘xxx-meta’,’xxx Details’,’xxx_meta_box’,’xxx-post-type’,’side’,’default’); error_log(‘meta box cb’); } function xxx_save_meta_box($post_id, $post) { error_log(‘running …’); die(‘OK!!!’); }

WordPress media manager multiple selection output

It was just my mistake… I’ve forgotten improve var selection jQuery(document).ready(function($){ var custom_uploader; $(‘#upload_image_button’).click(function(e) { e.preventDefault(); //If the uploader object has already been created, reopen the dialog if (custom_uploader) { custom_uploader.open(); return; } //Extend the wp.media object custom_uploader = wp.media.frames.file_frame = wp.media({ title: ‘Choose Image’, button: { text: ‘Choose Image’ }, multiple: true }); custom_uploader.on(‘select’, … Read more

Position right sidebar metabox right below the publish metabox?

Still if its something like client requirement then below is somewhat hack sort of solution. Add this code to your add_meta_box() function. For the sake of understanding, below I have provided complete function but you will need to use selective code 🙂 Do let me know how it goes. function myplugin_add_meta_box() { $screens = array( … Read more

Change Post Title Edit Box

You can add following code to your functions.php in the Theme-folder. Change the Custom Post Type(movie) name and the title to your wishes. function wpse213979_new_title_text( $title, $post ){ if ( ‘movie’ == $post->post_type ) { // Movie is the cpt name $title=”Enter movie name”; // The text you want to be shown } return $title; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)