WordPressの「WP-PostViews」プラグインで閲覧数(view数)に応じてランキング表示する方法 WordPressの「WP-PostViews」プラグインで閲覧数(view数)に応じてランキング表示する方法 <?php $rankings = array( 'post_type' => 'post', 'posts_per_page' =>… カスタムフィールドの値をWordPressの管理画面の投稿一覧に表示させる方法 下記の例では3つのカスタムフィールドの値を管理画面に表示しています。 functions.php/*投稿一覧に商品コード列追加 */ if (is_admin()) { function manage_posts_col… wordpress カスタムフィールドパラメータ(値)で並び変える(sort)方法 wordpress カスタムフィールドパラメータ(値)で並び変える(sort)方法これはカスタムフィールドの入力を数字にし、並び替えをしています。 <?php $cost_args = array( 'pos… advanced custom fields repeaterでリピーターの行の最大値を取得する方法 Count total number of repeater rows これで行の最大値を取得できます。 <?php get_sub_field('grid_block'); ?> このように変数に代入して使えます。 <?php if (have_rows('food_free_repeater')): ?> … wordpress 日付け別でデフォルト投稿とカスタム投稿を条件分岐する方法 heeder.php<?php elseif (is_date()): //日付別で条件分岐?> <?php if (get_post_type() == 'post'): ?> <h2>スタッフブログ</h2> <?php else: ?> …