WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Okay so I'm trying to render a meta box.

This is what I have so far, trying to keep it as basic as possible:

add_action('load-post.php', 'ad_templates_callback' );
add_action('load-post-new.php', 'ad_templates_callback' );

function ad_templates_callback(){
    add_action('add_meta_boxes', 'ad_templates_add_meta_box');
    add_action('save_post', 'ad_templates_save_post');

function ad_templates_add_meta_box(){
    add_meta_box( 'ad_templates', 'Template Options', 'ad_templates_render', 'page', 'normal', 'default');

function ad_templates_render($object, $box){
    wp_nonce_field( basename(__FILE__), 'ad_templates_nonce' );
    global $post_id;
            balblabl test
function ad_templates_save_post(){

I have no idea why, but it doesn't show up on either the New Page or existing Page pages.

I've tried it with removing the 'load-post.php' hooks and I've tried it with using Posts instead of Pages.

I've copied this code from an earlier WP theme I've created (which successfully shows the boxes), with a slight edit to the theme slug. So somewhere, somehow I'm missing something.

share|improve this question

Never mind I just went full potato and forgot to include the file into my functions.php

Is there any way to delete this question?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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