我想獲取所有帖子並插入到自定義表格中,但我無法獲得url(修復)的帖子,但它始終爲空或出現錯誤。無法從Wordpress數據庫獲得永久鏈接
$posts = get_posts(array( "showposts" => 50));
global $wpdb;
foreach($posts as $post)
{
$wpdb->insert('wp_employee', array('pottitle'=>$post->post_title, 'postid'=>$post->ID, , 'postid'=>$post->permalink), array('%s', '%s', '%s'));
}
是的它的工作謝謝:) – vivek 2014-09-23 11:59:59