Bagaimana Cara Membatasi Tag yang Muncul di Laman? #179
Unanswered
yuliakbard
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Coba begini: <?php $limit = 5; ?>
<?php foreach ($page->tags->chunk($limit, 0) as $tag): ?>
<a href="<?= $tag->link; ?>" rel="tag">
<?= $tag->title; ?>
</a>
<?php endforeach; ?>
Coba begini: <?php $name = 'slug-tag'; ?>
<?php if ($tag = $page->tags[$name]): ?>
<a href="<?= $tag->link; ?>" rel="tag">
<?= $tag->title; ?>
</a>
<?php endif; ?> |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Kalau saya tulis seperti diatas, hasilnya, semua tag yang terdapat pada halaman akan muncul.
Misal:
label1 label2 label3 label4
Bagaimana cara membatasi tag yang muncul, misalkan kita hanya ingin menampilkan 1 atau 2 tag, atau kita hanya ingin memunculkan tag tertentu
Misal: (saya ingin membatasi jumlah yang muncul)
label1
=> saya hanya ingin menampilkan label1Beta Was this translation helpful? Give feedback.
All reactions