【Word Press】Popular Posts プラグイン の表示を横に並べる方法

通常、縦に並ぶ Popular Posts プラグインの表示を横に並べる方法を調べた。

「Theme」に、「Tiles」 を選ぶ。

アイキャッチ画像を表示

サイズを手動で指定 300px;

・投稿の前 / 後:

<ul class="wpp-list wpp-tiles" style="margin-bottom:0;"></ul>

・投稿の HTML マークアップ:

<li style="display: inline-block;vertical-align: top;margin-bottom:5px;">{thumb}<div class="wpp-post-data">{title}</div></li>

・かなり強いスタイルが入っていて、強制的に縦向きになっているので、styleに直接「display: inline-block;」を書いて横向きにした。

・スマホだと縦に並ぶ。

・最後の「li」タグだけ下にズレていたので、「vertical-align: top;」を書いて整えた。

上記の設定をすると、こんな風に人気記事を横並びに表示できた。