开发者

WP: writing an admin plugin for managing custom content

A client of mine has a site in wordpress, with one section being a directory of agents that each have different text and videos associated with them.

The client wants to be able to easily add/remove/change these agents from within the wordpress admin interface. There will be anywhere from 50-75 of these agents, so doing each page manually is not very attractive.

We currently have 3 agents added as posts, and i understand that we can store additional information inside the post itself, so that is not a pro开发者_JAVA百科blem. What we would like to create is a simpler way of managing those pages where the content cannot be changed by the maintainer, and the additional fields on the post are hard coded so there would be no room for user error.

What i am interested in is if anyone has done something similar in the past and can share their approach and experience, or if anyone can point me in the right direction as to how i can accomplish this and what i need to be aware of.

Thanks.


Yes, Custom Post Types are a perfect fit for your needs. Here are some links to articles explaining them:

  • http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
  • http://www.wpbeginner.com/wp-tutorials/how-to-use-custom-post-types/
  • http://thinkvitamin.com/dev/create-your-first-wordpress-custom-post-type/

You can use a plugin like Custom Post Type UI or just add the register_post_type() calls to your theme's functions.php file:

  • http://wordpress.org/extend/plugins/custom-post-type-ui/

Then you can use a plugin like "Simple Fields" to add metaboxes to your Agent post type (although there are numerous plugins offering similar functionality; I'm building one myself!):

  • http://eskapism.se/code-playground/simple-fields/

Hope this helps...


Have you thought about using custom post types? You could create type called Agent and then each agent would be like a post. That way you could search for specific agents easily in the admin and then go in to the post for each agent to change their details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜