ワードプレスのカスタム投稿の記事を50音順に並べ替えたくて、ACFでふりがな[furigana]というカスタムフィールドを作り
クエリで並べ替えを指定した所上手く並べ替え出来ませんでした。
なぜ並び替わらないのか原因が特定出来ないため、どうかよろしくお願いします。
$myQuery = new WP_Query(); $param = array( 'posts_per_page' => '-1', 'post_type' => 'account', 'orderby' => 'meta_value', 'meat_key' => 'furigana', 'order' => 'DESC', 'post_status' => 'publish', ); $myQuery->query($param); if($myQuery->have_posts()): while($myQuery->have_posts()) : $myQuery->the_post(); $aUrl = get_field('accounturl');//var_dump($aUrl); ?> <div> <?php if(!empty($aUrl)){ ?> <a href="http://<?php the_field('accounturl'); ?>" target="_Blank"><?php }else{echo "<span>";} ?> <?php the_title(); echo "<br />";the_field('furigana'); ?> <?php if(!empty($aUrl)){ echo "</a>";}else{echo "</span>";} ?> </div> コード
ひらがなで入力したfuriganaのメタキーどおりに並び替わらないのです。
どうぞよろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/30 07:10
2018/03/30 07:12
2018/04/07 08:14