2011-06-09 41 views

回答

1

最后我检查了一个术语或分类标准的创建日期并没有存储在WP模式的任何地方。该信息仅可用于岗位......即使这样,你只有MODIFIED_DATE:

CREATE TABLE `wp_posts` (
    `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 
    `post_author` bigint(20) unsigned NOT NULL DEFAULT '0', 
    `post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 
    `post_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 
    `post_content` longtext NOT NULL, 
    `post_title` text NOT NULL, 
    `post_excerpt` text NOT NULL, 
    `post_status` varchar(20) NOT NULL DEFAULT 'publish', 
    `comment_status` varchar(20) NOT NULL DEFAULT 'open', 
    `ping_status` varchar(20) NOT NULL DEFAULT 'open', 
    `post_password` varchar(20) NOT NULL DEFAULT '', 
    `post_name` varchar(200) NOT NULL DEFAULT '', 
    `to_ping` text NOT NULL, 
    `pinged` text NOT NULL, 
    `post_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 
    `post_modified_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 
    `post_content_filtered` text NOT NULL, 
    `post_parent` bigint(20) unsigned NOT NULL DEFAULT '0', 
    `guid` varchar(255) NOT NULL DEFAULT '', 
    `menu_order` int(11) NOT NULL DEFAULT '0', 
    `post_type` varchar(20) NOT NULL DEFAULT 'post', 
    `post_mime_type` varchar(100) NOT NULL DEFAULT '', 
    `comment_count` bigint(20) NOT NULL DEFAULT '0', 
    PRIMARY KEY (`ID`), 
    KEY `post_name` (`post_name`), 
    KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`), 
    KEY `post_parent` (`post_parent`), 
    KEY `post_author` (`post_author`) 
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 

CREATE TABLE `wp_terms` (
    `term_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 
    `name` varchar(200) NOT NULL DEFAULT '', 
    `slug` varchar(200) NOT NULL DEFAULT '', 
    `term_group` bigint(10) NOT NULL DEFAULT '0', 
    PRIMARY KEY (`term_id`), 
    UNIQUE KEY `slug` (`slug`), 
    KEY `name` (`name`) 
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 

CREATE TABLE `wp_term_taxonomy` (
    `term_taxonomy_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 
    `term_id` bigint(20) unsigned NOT NULL DEFAULT '0', 
    `taxonomy` varchar(32) NOT NULL DEFAULT '', 
    `description` longtext NOT NULL, 
    `parent` bigint(20) unsigned NOT NULL DEFAULT '0', 
    `count` bigint(20) NOT NULL DEFAULT '0', 
    PRIMARY KEY (`term_taxonomy_id`), 
    UNIQUE KEY `term_id_taxonomy` (`term_id`,`taxonomy`), 
    KEY `taxonomy` (`taxonomy`) 
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 
+0

谢谢你的回复。但是,有时候id不能排序:-( – abhis 2011-06-09 12:15:47

+0

尝试使用'term_taxonomy_id'来排序,这是一个相当不错的代理(虽然我不确定它实际上是否可行)。 – 2011-06-09 12:20:23

5

其实我不知道,如果类别都具有创建日期,但如果你订单来自序号,你应该得到的相同的结果。

get_categories(array('orderby'=>'id','order'=>'ASC')); 
相关问题