$posts = $GLOBALS['wpdb']->get_results("SELECT ID,post_content, post_title FROM wp_posts WHERE post_status = 'publish' AND post_type='post' LIMIT 1");
$permalink=get_permalink($posts[ID]);
$title=$posts[post_title];
$content=$posts[post_content];
$file = fopen("D://sam7.txt", "w");
fwrite($file,$permalink);
fclose($file);
$file = fopen("D://sam8.txt", "w");
fwrite($file,$title);
fclose($file);
Im unable to print $title in sam8.txt, but $permalink print properly. how can i get the value of title.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire