I want to know something about this article
In order to create custom post types, open your template’s functions.php file in an editor, and place the following function within the file:
Where is this file function.php in wordpress 3.开发者_如何学运维0.3
You must open the file functions.php
that is in your template directory, in /wp-content/themes/your-theme-name
.
If the file is not present, create it.
It is /wp-content/themes/[name-of-theme]/functions.php
e.g if twentyten (default theme)
/wp-content/themes/twentyten/functions.php
Custom post types and custom taxonomies should be added through a plugin, and not through a theme. It is the recommended way to add these.
Just a couple of reasons why you should add custom post types and taxonomies via a plugin
custom post types and custom taxonomies add functionality to your site, and not your theme. They also do not add visual benefit to your theme
custom post types and custom taxonomies should remain available across themes. If a theme is changed, these should still be available to the next theme activated
精彩评论