Registering "Theme Options" on Custom Post Type / Taxonomy


Author Message
Don

Posted: 3/6/2013
Quote message 

I am using a third party plugin to create a custom post type and would like to be able to use the "Theme Options" page setting control on my Custom Post Type edit screen so that I am able to check and display the sidebar on the custom post type as well as make the other changes.

Does anybody know which edits I would need to make to the Artisteer Template files in order for the Theme Options to appear while creating an instance of a my Custom Post Type ?

I'm a little new to PHP, so thank you in advance...
 
Ralph

Posted: 3/19/2013
Quote message 

I have exactly the same problem and would be grateful for any advice how to do this.
 
Abland

Posted: 3/19/2013
Quote message 

Hi, Don and Ralph,

Let's say the custom post type is "My Posts". What's needed is the slug for that type. In the WP admin, if you click on the post type the slug will be in the end of the address bar:
?post_type=my-posts

In your theme's "library/admins.php" find approximately line 142:
function theme_add_meta_boxes() {

You need to create new "add_meta_box("

Copy a Theme Options and a Page Header Image - does not matter which:
add_meta_box( 'theme_meta_box',

__('Theme Options', THEME_NS),
'theme_print_post_meta_box',
'post',
'side',
'low'
);
add_meta_box( 'theme_header_image_meta_box',
__('Page Header Image', THEME_NS),
'theme_print_page_header_image_meta_box',
'page',
'side',
'low'
);

Paste back into the function, and change the slug from page or post to your custom post slug:
add_meta_box( 'theme_meta_box',

__('Theme Options', THEME_NS),
'theme_print_post_meta_box',
'my-posts',
'side',
'low'
);
add_meta_box( 'theme_header_image_meta_box',
__('Page Header Image', THEME_NS),
'theme_print_page_header_image_meta_box',
'my-postes',
'side',
'low'
);

 
Abland

Posted: 3/19/2013
Quote message 

Typo in the second - spelled my-postes but should be my-posts
 
Arne

Posted: 10/19/2014
Quote message 

Wow - this was exactly what I needed. But for whatever reason it only worked half for me. Maybe you could give me a hint what I did wrong?

The thing is that they show up in my custom posts/pages. But the functionality is non and they are not working. I can check the checkboxes. But as I save, at reloading, they will be set as default but not as I needed them.

PS: I am using Magic Fields 2 https://wordpress.org/plugins/magic-fields-2/ for creating the Custom Post Types.

It would be really great, if you could give me a hint that helps me making this work. Thank you so much.

- Arne
 
Josicus

Posted: 10/22/2014
Quote message 

bookmarked this...thanks