Create HTML file with get_archives()
-
Dear Friends:
Your help file for get_archives() function tells me that it “Displays a list of archives”. However I need to redirect it HTML file with. I tried the code:
<?php
require(‘wp-blog-header.php’);
$file = ‘recent-headers.html’;
$data = get_archives(‘postbypost’,’5′,’html’);
$fp = fopen($file, “w”);
fwrite($fp, $data);
fclose($fp);
echo ($data);
?>
but it directs the output only to the screen — the created file contains no headers info (only some initial HTML headers).
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Create HTML file with get_archives()’ is closed to new replies.