Ben farklı sayfaları yüklenen farklı içeriği görüntülemek için wordpress bu kodu kullanıyorum. Ben Ev, Bio, Çalışma, İletişim ve Notlar denilen sitede 5 sayfa var. Notlar sayfası, bir blog olarak kullanılıyor. İşte ben kullanıyorum kodudur.
<?php if (is_page('contact')) { ?>
get in touch with me
<?php } elseif (is_single()) { ?>
a note from me
<?php } elseif (is_page('notes')) { ?>
the notes of me
<?php } else { ?>
the <?php the_title(); ?> of me
<?php } ?>
Bu yüzden iletişim sayfası, eğer "Benimle temasa" görüntüler ve tek bir blog yazısı sayfası eğer "Bana bir not" görüntülenir. Ben bir sorun var nerede Ancak bu. Bu notlar sayfası açıkken bir sonraki deyimi "beni notları" göstermesi gerekir. Ancak, bu olmaz. Bunun yerine "else" deyiminde olduğu varsayılan içeriğini gösterir. Bu neden oluyor herhangi bir fikir?