简体   繁体   中英

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?

您应该将这些值存储在自定义字段中

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.

"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.

Eg

$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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM