前提・実現したいこと
wordpressで作られたページの修正をしていますが、どうにもならないのでお力を貸してください。
カスタム投稿(CPT UI)でブログを作成されていてTOPが静的ページ(index.html)になっています。
index.htmlにカスタム投稿の新着を入れ込みたいと考えていますがうまくいきません。
発生している問題・エラーメッセージ
まったく表示されません。
<?php require_once('wp/wp-load.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> ↑こちらをindex.htmlの一行目に記載。 <ul> <?php $myposts = get_posts('numberposts=5&orderby=post_date'); foreach($myposts as $post) : setup_postdata($post); ?> <li><?php the_time('Y/m/d') ?> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> ↑こちらをindex.htmlの表示したい場所に記載 ```ここに言語名を入力
試したこと
上のタグを組み込んでます。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/08 08:26
2018/04/08 08:44
2018/04/09 06:40