オリジナルのtheme(テーマ)を作る09:ページャーを表示させる(トップページ)


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/tomisan/www/info/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

ページャー、、カタカナで書くとなんかヘン(笑)
pagerは、前へ次へとリンクするやつです。トップページを複数のページに分割させてpagerで移動します。
※設定画面で1ページに表示する記事の数を指定しておきましょう~。
デフォルトでは10件になっています。

<?php if(is_home()): ?>
    <nav>
    <ul class="pager">
        <li class="previous"><?php next_posts_link('<i class="fa fa-angle-left"></i> Older'); ?></li>
        <li class="next"><?php previous_posts_link('Newer <i class="fa fa-angle-right"></i>'); ?></li>
    </ul>
    <!--//pager -->
    </nav>
    <!--//nav -->
<?php endif; ?>

bootstrapのnext・prevと、wordpressのnext・prevが逆だということに気付いた(笑)
bootstrapは、prevは古いほうを指して、nextは新しいほうを指すけれど(古い:prevが左、新しい:nextが右)
wordpressはprevは新しいほうを指して、nextは古いほうを指す。(古い:nextが左、新しい:prevが右)
なんかややこしいなぁ(;´Д`)

<?php if(is_home()): ?>~<?php endif; ?>

トップページだけに出力したいものをこの中に書きます。
※各記事の個別のページには出力されません。

<i class="fa fa-angle-left"></i>

パラメーターに記述しているiタグ部分は、Font-Awesomeのアイコンを表示させています。
Font Awesome

コメントは受け付けていません。