I have a custom post type called "media" and I would like to be able to upload a single pdf called, "presskit" for the archive page that contains ALL of the media custom posts.

I only need to upload / associate a single PDF with the archive...it would be nice to make this is a submenu page, i.e. something like:

add_action('admin_menu', 'register_media_submenu_page'); 

    function register_media_submenu_page() {
        add_submenu_page( 'edit.php?post_type=media', 'Press Kit', 'Press Kit', 'manage_options', 'press_kit_file', press_kit );

    function press_kit() {
        echo '<div class="wrap">';
        echo '<h2>Upload a press kit</h2>';

        echo '</div>';

However, if this is too complicated I think the next best option is if the client could replace the pdf in the media library with a new pdf whenever they wanted to (keeping the same ID?)


I recommend this plugin all of the time even though I have no association whatsoever with the plugin or the author of it. It's free and allows you to add custom upload fields and all kinds of goodies to your edit screens without touching code. It's called Advanced Custom Fields. Some developers would frown upon suggesting a plugin instead of writing something yourself, but seriously why reinvent the wheel when there is a free solution already?

That plugin will do what you want and make it a hell of a lot easier for you and the client in the long run.

| improve this answer | |
  • Part of my question is that I thought custom fields only attach to a specific post (or a type of custom post) or a page or an id...will this work for an archive page? – redconservatory Mar 12 '12 at 12:59

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.