プラグイン開発は初めてです。特定のページ/投稿のすべての画像を取得し、ページの下にスライドショーとして表示したい..現在、すべての画像をメディア ライブラリに集めて表示することができます...しかし、私はその特定のページの場合に画像が必要..特定のテンプレートの画像を取得するには、その特定の投稿テンプレートにコード行を追加する必要があることを学びました..しかし、プラグインを使用してそれを行う方法
$query_images_args = array(
'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,
);
$query_images = new WP_Query( $query_images_args );
$images = array();
foreach ( $query_images->posts as $image) {
$images[]= wp_get_attachment_url( $image->ID );
}
foreach($images as $item){
/// any function not yet decided
}
echo($item);
$item で画像の URL を取得しています。画像の属性を変更し、元の画像を元の位置で操作した画像に置き換えたいと考えています。