im trying to save different value of radio buttons on same name, it works and was able to make checked appear if the correct value is saved.

As you can see on the screenshot ABOVE (which is taken on view-source:), it the correct selected input is CHECKED already however even if it's check you can see on the screenshow BELOW that it doesn't display as checked.

enter image description here

It's already checked but not displaying , i dont know

  • Can you inspect the css of the radio button? – Tamil Selvan C Feb 23 '17 at 1:48
  • I inspect the css of the radio button too, i tried selecting 1 frm the radio button and the checked icon appear. But on page load, the checked icon doesn't appear on the radio input. – Archangel17 Feb 23 '17 at 2:57

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:

enter image description here

WordPress already provides a function for this checked()

<input type="radio" name="colors" id="blue" <?php checked( 'red', get_option( 'color' ) ); ?> />

so you dont have to do an If and echo.

| improve this answer | |

I think you can Also try it checked="checked" some time issue with checked so just try it.


Replace with

| improve this answer | |

Thanks a lot everyone for all your time! I really appreciate it!

I've finally found what's causing it to appear and it's because i forgot to remove the old sets of radio buttons with the same id as that on a different meta box.

I've finally fixed it! Thank you!

| improve this answer | |

Check if you have another group of input radio button with the same name be the issue. Just rename other groups of input radio button with different name, should resove the issue.

In your case name='seasons' should not be used for another radio button group.


| improve this answer | |
  • Thanks.. It's Right. Don't know why it's Downgrade – Sachin Sanchaniya Jun 10 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.