トップページ(WP以外のindex.html)に最新記事を日付、タイトル、文章、サ
-
こんにちは、初心者です。
既存のHTMLサイトにWPを追加し、トップページ(WP以外のindex.html)に最新記事を日付、タイトル、文章、サムネイル画像付きで呼び出したいのです。タイトルと日付は呼び出せましたが、文章とサムネイル画像が呼び出せません。
ソースにも出力されていませんでした。環境:
WordPress/3.0.1
Theme/Twentyten1.1
PHP/5.8.8
MySQL/5.0.45
Apache/1.3.371)htaccess をhtmlでもPHPが動くよう設定変更。
.htaccess
AddHandler x-httpd-php528 .php .html
2)http://hato-style.chu.jp/note/wpwordpress.html
を参考にindex.htmlを変更。index.html
<?php require('wp-load.php'); ?> <?php $newentry = get_posts('numberposts=3'); foreach($newentry as $post) : ?> サムネイル:<br /> <?php the_post_thumbnail(); ?><br /> タイトル:<br /> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /> 日付:<br /> <?php the_time('Y.m.d'); ?><br /> 文章:<br /> <?php the_content(); ?><br /> <?php endforeach; ?>
もしできるなら、タグやコードなど教えていただけると助かります。
よろしくお願い致します。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「トップページ(WP以外のindex.html)に最新記事を日付、タイトル、文章、サ」には新たに返信することはできません。