Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hideki-a/e2d172d1e2daaf5a34e5 to your computer and use it in GitHub Desktop.

Select an option

Save hideki-a/e2d172d1e2daaf5a34e5 to your computer and use it in GitHub Desktop.
ダイナミックパブリッシングで記事をランダムに表示する。スタティックの場合はRandom Entriesプラグインが使えるかと。
<mt:Entries>
<mt:SetVarBlock name="tmp.entry_ids" function="push"><$mt:EntryID$></mt:SetVarBlock>
</mt:Entries>
<mt:Ignore>MTArrayShuffle...alfasado/mt-plugin-get-hash-varのインストールで利用可能なファンクションタグ</mt:Ignore>
<$mt:ArrayShuffle name="tmp.entry_ids"$>
<mt:Loop name="tmp.entry_ids">
<mt:If name="__first__"><ul></mt:If>
<mt:Entries id="$__value__">
<li><$mt:EntryID$>: <$mt:EntryTitle$></li>
</mt:Entries>
<mt:If name="__last__"></ul></mt:If>
</mt:Loop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment