0

I have created a metabox on a CPT's submenu page created using add_meta_box. I see the metabox's style is not similar to the other metaboxes available on post edit pages. Moreover, the accordion type control doesn't work here. When I had added the same metabox on a post edit page, everything worked as expected. I'm sure I need to enqueue default styles and scripts this custom page. How do I do it?

Update: This is how I have created my metabox:

add_action("load-troll-cpt_page_show-trollers", "troll_add_metaboxes");
function troll_add_metaboxes() {
    add_meta_box("troll-metabox", "Troll Meta", "display_troll_metabox", "troll-menu-page", "normal", "core");
}

function display_my_metabox() {
    echo "This is the metabox content";
}

Here is how the metabox looks like:

enter image description here

  • How did you create the metabox? Post your code please. – s_ha_dum Jun 2 '15 at 14:27
  • Okay, I will edit my answer. – Rutwick Gangurde Jun 2 '15 at 14:29

Your Answer

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

Browse other questions tagged or ask your own question.