我想获取所有帖子并插入到自定义表格中,但我无法获得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