开发者

Adding custom content to a Wordpress blog

Is there a way in a Wordpress blog to get the admin side of Wordpress to add custom content in the database, that will not be anything related to 开发者_开发知识库posts or pages?

It will just be a little bit of info such as date, title, description, and an image that I will use in a specific part of the front page.

Is wordpress too restrictive on this, will I have to use a different CMS?

Edit:

Could Custom Post Types be what I am looking for?


"It will just be a little bit of info such as date, title, description, and an image that I will use in a specific part of the front page."

So, if I am reading this correctly, you want to create a custom post type, which describing what you are saying - "date, title, description, image" - this is basically a post ;)

You can easily hook into the wordpress query object.

E.g.

$args = array(
    'post_type'=>'my_special_post',
    'posts_per_page'=>8
);
query_posts($args);

The the normal while posts applies. If you don't want it to be in within the post array, then nothing is stopping you from just creating your own queries which is well explained here: http://codex.wordpress.org/Custom_Queries.

I should add creating post types as well - they are easily configured in your functions.php file without need to add a plugin. Unless you want a more managed solution: http://codex.wordpress.org/Post_Types


You should store these values in custom fields.


Recent WP releases fully support custom types: http://codex.wordpress.org/Post_Types#Custom_Types

This allows you to create a new, full-class data type that will have a new menu option below post and page.

Also, take a look at the More Types plugin (http://wordpress.org/extend/plugins/more-types/), which provides an easy and powerful GUI for doing this. Along with More Fields by the same author (http://wordpress.org/extend/plugins/more-fields/), WP becomes a pretty powerful CMS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜