私はACF Repeaterフィールドを使ってwordpressから7つの画像を呼び出すWebページを持っています。私が何をしたいかACFを使用してPHPのURLのリストをランダム化する方法は?
は、それらの画像をWebページにランダムに表示されるようにURLの画像の一覧を取得し、それらをシャッフルです。 ($image['url'])
で画像を呼び出すと、表示される画像はWordpressサイトに最後にアップロードされた画像のみです。
<?php
// Call the ACF Gallery images
$imageArray = get_field('company_logos', 13);
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if($imageArray):
while(have_rows('company_logos', 13)) : the_row();
$image = get_sub_field('image');
// $content = get_sub_field('content');
//shuffle ($image['url']);
$arr = $image['url'];
shuffle($arr);
print_r($arr);
endwhile;
endif; ?>
私は、彼らがの形式で出てくる画面に画像のURLのをエコー:
http://localhost/wordpress/wp-content/uploads/2016/07/a.jpg
http://localhost/wordpress/wp-content/uploads/2016/07/b.png
http://localhost/wordpress/wp-content/uploads/2016/07/c.jpg
http://localhost/wordpress/wp-content/uploads/2016/07/d.jpg
http://localhost/wordpress/wp-content/uploads/2016/07/e.jpg
http://localhost/wordpress/wp-content/uploads/2016/07/f.jpg
http://localhost/wordpress/wp-content/uploads/2016/07/g.jpg
これを行う方法を誰もが知っていますか? ありがとう!
具体的な問題を明確にしたり、必要なものを明確に強調してください。現在書かれているとおり、あなたが求めていることを正確に伝えるのは難しいです。この質問を明らかにするには、[How to Ask](http://stackoverflow.com/help/how-to-ask)ページを参照してください。 –
最初の投稿にはお詫び申し上げますが、これは意味がありますか? – HowsThatMonkey