I have spent hours scoring the search engines including the search on here.
But I can find no way to change the author for custom post types.
Why you might ask? Because I want to pull custom author meta data from the user’s profile on the custom post.
I have ten users (of course each has different facebook and twitter accounts)
And I want to display those for the sidebar on all custom posts each user writes.
I initially created all of the posts. But now I can’t find a way to make each person the author of their own custom post under custom post type
For normal posts, its simple – you have the box to edit it.
SO is there script I could add to my functions.php which would turn on the author assignment? Or is there a simpler solution?
You can designate an author in custom post types just like normal posts. If you’re not seeing the meta box with the option, open “Screen Options” (top right) and make sure the Author box is set to display.
Thats whats odd. I just double checked. See my screencap.
Nothing available for authors. Same thing when viewing all posts in the custom post section.
And when editing a single post in custom post.
Do I need to do something in the code when setting up the custom post, to enable it? I have not disabled it.
Its available on regular posts.
For example, if you want to use the first function, something like this should work:
<?php add_post_type_support( 'my_post_type', 'author' ) ?>
Edit (that’s what I get for not properly reading the codex):
You should do as the codex page says and hook that up to ‘init’.
- The topic ‘Custom Post Type : How to Change Author’ is closed to new replies.