【wordpress】pagenationのNEXTとPREVに画像を使いたい時の対処法
wordpressの'index.php'などで次のページなどを表示したいとき、'prefious_post_link('%link','NEXT')'を使うと思います。
この時、テキストリンクだった場合はこれでいいんですが、画像を使いたいときに'bloginfo(template_url)'が使えないのです。
なので代わりにこれを使ってテンプレート内の画像を引っ張ってきます。
'get_template_directory_uri()'
<div class="pagenation">
<div class="prev"><?php previous_post_link('%link','<img src="' . get_template_directory_uri() . '/img/prev_off.png" alt="PREV" />'); ?></div>
<div class="next"><?php next_post_link('%link','<img src="' . get_template_directory_uri() . '/img/next_off.png" alt="NEXT" />'); ?></div>
</div>
これで完了!